mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Make sure window.shutdown is only called once
This commit is contained in:
parent
43aa1aaeb7
commit
b24a13991a
@ -109,3 +109,9 @@ describe "Window", ->
|
||||
shutdown()
|
||||
|
||||
expect(editor1.getBuffer().subscriptionCount()).toBe 0
|
||||
|
||||
it "only serializes window state the first time it is called", ->
|
||||
deactivateSpy = spyOn(atom, "setRootViewStateForPath").andCallThrough()
|
||||
window.shutdown()
|
||||
window.shutdown()
|
||||
expect(atom.setRootViewStateForPath.callCount).toBe 1
|
||||
|
@ -8,6 +8,7 @@ require 'underscore-extensions'
|
||||
require 'space-pen-extensions'
|
||||
|
||||
deserializers = {}
|
||||
wasShutdown = false
|
||||
|
||||
windowAdditions =
|
||||
rootViewParentSelector: 'body'
|
||||
@ -68,6 +69,8 @@ windowAdditions =
|
||||
$(rootViewParentSelector).append(rootView)
|
||||
|
||||
shutdown: ->
|
||||
return if wasShutdown
|
||||
wasShutdown = true
|
||||
atom.setWindowState('pathToOpen', project.getPath())
|
||||
atom.setRootViewStateForPath project.getPath(),
|
||||
project: project.serialize()
|
||||
|
Loading…
Reference in New Issue
Block a user