Restore saved state when adding folders to empty project

This commit is contained in:
Katrina Uychaco
2017-03-08 14:40:58 -08:00
committed by Michelle Tilley
parent 12ea7a7300
commit d891f2376c
2 changed files with 116 additions and 9 deletions

View File

@@ -861,7 +861,11 @@ class AtomEnvironment extends Model
addProjectFolder: ->
@pickFolder (selectedPaths = []) =>
@project.addPath(selectedPath) for selectedPath in selectedPaths
@loadState(@getStateKey(selectedPaths)).then (state) =>
if state && @project.getPaths().length is 0
@restoreStateIntoEnvironment(state)
else
@project.addPath(selectedPath) for selectedPath in selectedPaths
restoreStateIntoEnvironment: (state) ->
shouldSerializeItem = (item) ->