Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: make first action undo-able
Browse files Browse the repository at this point in the history
  • Loading branch information
barinali authored and marionebl committed Jun 12, 2018
1 parent d6d5ec7 commit 6c645cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ const userStore = new ElectronStore();
case ServerMessageType.AppLoaded: {
const pathToOpen = projectPath || openedFile;

send({
id: uuid.v4(),
type: ServerMessageType.StartApp,
payload: String(port)
});

// Load one of either
// (1) last known file automatically in development
// (2) file passed to electron main process
Expand All @@ -108,12 +114,6 @@ const userStore = new ElectronStore();
}
}

send({
id: uuid.v4(),
type: ServerMessageType.StartApp,
payload: String(port)
});

break;
}
case ServerMessageType.CreateNewFileRequest: {
Expand Down
4 changes: 3 additions & 1 deletion src/electron/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Sender.receive(message => {
case ServerMessageType.StartApp: {
app.setState(Types.AppState.Started);
store.setServerPort(Number(message.payload));
store.commit();
break;
}
case ServerMessageType.OpenFileResponse: {
Expand All @@ -71,13 +70,16 @@ Sender.receive(message => {
type: ServerMessageType.CheckLibraryRequest
});
}

store.commit();
break;
}
case ServerMessageType.CreateNewFileResponse: {
history.clear();
const newProject = Project.from(message.payload.contents);
store.setProject(newProject);
app.setActiveView(Types.AlvaView.PageDetail);
store.commit();
break;
}
case ServerMessageType.Log: {
Expand Down

0 comments on commit 6c645cd

Please sign in to comment.