remote-save: store session path in client session manager to reset it if the server is rebooted

This commit is contained in:
jean-emmanuel 2019-01-05 17:51:27 +01:00
parent 49f117924c
commit 679acfab79

View file

@ -16,9 +16,14 @@ var SessionManager = class SessionManager {
this.session = []
this.lock = false
this.sessionPath = ''
this.allowRemoteSave = false
ipc.on('connect', ()=>{
ipc.send('sessionSetPath', {path: this.sessionPath})
})
}
load(session, callback) {
@ -85,8 +90,8 @@ var SessionManager = class SessionManager {
loader.close()
container.classList.add('show')
this.lock = false
this.allowRemoteSave = false
editor.unsavedSession = false
this.sessionPath = ''
if (callback) callback()
}, 25)
@ -169,7 +174,8 @@ var SessionManager = class SessionManager {
open(data) {
this.load(data.session,function(){
this.load(data.session, ()=>{
this.sessionPath = data.path
ipc.send('sessionOpened', {path: data.path})
})
@ -178,7 +184,7 @@ var SessionManager = class SessionManager {
browse() {
upload('.json', (path, result)=>{
ipc.send('sessionOpen',{file:result,path:path})
ipc.send('sessionOpen',{file:result, path:path})
}, ()=>{
new Popup({title: raw(icon('exclamation-triangle')) + '  ' + locales('error'), content: locales('session_uploaderror'), closable:true})
})