mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Serialize window state in telepath format
This commit is contained in:
committed by
Kevin Sawicki
parent
85cc81851f
commit
9b22ca4825
@@ -270,10 +270,11 @@ window.atom =
|
||||
console.warn "Error parsing window state: #{windowStatePath}", error.stack, error
|
||||
|
||||
windowState ?= {}
|
||||
telepath.Document.create(windowState, site: telepath.createSite(1))
|
||||
site = telepath.createSite(1)
|
||||
telepath.Document.deserialize(windowState, {site}) ? telepath.Document.create({}, {site})
|
||||
|
||||
saveWindowState: ->
|
||||
windowStateJson = JSON.stringify(@getWindowState().toObject())
|
||||
windowStateJson = JSON.stringify(@getWindowState().serialize())
|
||||
if windowStatePath = @getWindowStatePath()
|
||||
fsUtils.writeSync(windowStatePath, windowStateJson)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user