Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send event to save state after 'Add Project Folder' or 'Remove Projec… #12545

Merged
merged 3 commits into from Jan 9, 2017

Conversation

@yuanwhy
Copy link
Contributor

commented Aug 29, 2016

Fixes #12495

When we add or remove project folder, the window's current project path will be changed, then "initialPaths" will be reloaded, it is the best time to save state

/cc @maxbrunsfeld @lee-dohm

@@ -126,6 +126,8 @@ class ApplicationDelegate
loadSettings = getWindowLoadSettings()
loadSettings['initialPaths'] = paths
setWindowLoadSettings(loadSettings)
ipcRenderer.send("did-save-state")

This comment has been minimized.

Copy link
@maxbrunsfeld

maxbrunsfeld Aug 29, 2016

Contributor

I think we should rename the event from did-save-state to did-change-paths. The current name did-save-state makes it sound like Atom already did save the state.

@maxbrunsfeld

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2016

This looks great to me; I left one minor comment. I would like to add a test for this behavior. @yuanwhy are you willing to add the test for this? I think that it should be added to this test file.

@yuanwhy

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2016

@maxbrunsfeld I renamed the event name. I will appreciate it if you could add a test for this behavior, I am not good at the test code

@@ -126,6 +126,8 @@ class ApplicationDelegate
loadSettings = getWindowLoadSettings()
loadSettings['initialPaths'] = paths
setWindowLoadSettings(loadSettings)
ipcRenderer.send("did-change-paths")

This comment has been minimized.

Copy link
@thomasjo

thomasjo Aug 30, 2016

Member

🔥 this empty line

@maxbrunsfeld maxbrunsfeld merged commit 1320ff2 into atom:master Jan 9, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.