hot-reload: clean backup only after it's been consumed
This commit is contained in:
parent
ce27b8e052
commit
6e566d9d3e
2 changed files with 14 additions and 2 deletions
|
|
@ -24,7 +24,6 @@ module.exports = {
|
|||
|
||||
if (data.backupId && sessionBackups[data.backupId]) {
|
||||
ipc.send('loadBackup', sessionBackups[data.backupId])
|
||||
delete sessionBackups[data.backupId]
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -315,6 +314,12 @@ module.exports = {
|
|||
|
||||
},
|
||||
|
||||
deleteBackup: function(data) {
|
||||
|
||||
delete sessionBackups[data]
|
||||
|
||||
},
|
||||
|
||||
reloadCss:function(){
|
||||
theme.load()
|
||||
ipc.send('reloadCss')
|
||||
|
|
|
|||
|
|
@ -140,12 +140,19 @@ module.exports = {
|
|||
loadBackup: function(data) {
|
||||
|
||||
session.load(data.session, ()=>{
|
||||
|
||||
state.set(data.state, false)
|
||||
|
||||
editor.historySession = deepCopy(data.session)
|
||||
editor.history = data.history
|
||||
editor.historyState = data.historyState
|
||||
if (data.sidepanelOpened) sidepanel.open()
|
||||
if (data.editorEnabled) editor.enable()
|
||||
|
||||
if (data.sidepanelOpened) sidepanel.open()
|
||||
|
||||
|
||||
ipc.send('deleteBackup', data.backupId)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue