mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Make an option to *always* restore the last session, no matter how Atom is invoked (#9643), part3: use _.cloneDeep from lodash instead of own clone function
This commit is contained in:
@@ -112,7 +112,7 @@ class AtomApplication
|
||||
launch: (options) ->
|
||||
if options.pathsToOpen?.length > 0 or options.urlsToOpen?.length > 0 or options.test or options.benchmark or options.benchmarkTest
|
||||
if @config.get('core.restorePreviousWindowsOnStart') is 'always'
|
||||
@loadState(clone(options))
|
||||
@loadState(_.cloneDeep(options))
|
||||
@openWithOptions(options)
|
||||
else
|
||||
@loadState(options) or @openPath(options)
|
||||
@@ -814,10 +814,3 @@ class AtomApplication
|
||||
args.push("--resource-path=#{@resourcePath}")
|
||||
app.relaunch({args})
|
||||
app.quit()
|
||||
|
||||
clone = (obj) ->
|
||||
return obj if obj is null or typeof (obj) isnt "object"
|
||||
temp = new obj.constructor()
|
||||
for key of obj
|
||||
temp[key] = clone(obj[key])
|
||||
temp
|
||||
|
||||
Reference in New Issue
Block a user