dev: persistent fragments upon auto reload
This commit is contained in:
parent
1ab5291f63
commit
75a9173fcb
1 changed files with 5 additions and 1 deletions
|
|
@ -16,10 +16,11 @@ module.exports = {
|
|||
cache.set('backup', {
|
||||
session: session.session.data,
|
||||
sessionPath: session.sessionPath,
|
||||
fragments: session.fragments,
|
||||
state: state.get(),
|
||||
history: editor.history,
|
||||
historyState: editor.historyState,
|
||||
editorEnabled: editor.enabled
|
||||
editorEnabled: editor.enabled,
|
||||
}, false)
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +38,9 @@ module.exports = {
|
|||
var data = localBackup
|
||||
|
||||
cache.remove('backup', false)
|
||||
for (let k in data.fragments) {
|
||||
session.setFragment({path: k, fileContent: JSON.parse(data.fragments[k])})
|
||||
}
|
||||
session.load(data.session, ()=>{
|
||||
|
||||
state.set(data.state, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue