launcher: cancel stopping the server when there are unsaved changes in the built-in client
This commit is contained in:
parent
44f43cb144
commit
54ea332ad6
2 changed files with 17 additions and 4 deletions
|
|
@ -7,6 +7,7 @@
|
|||
- bug fixes
|
||||
- remote-root option not applied on resources loaded by the client app (css images, etc)
|
||||
- input: display issue when resizing the window
|
||||
- launcher: cancel stopping the server when there are unsaved changes in the built-in client
|
||||
|
||||
- editor
|
||||
- context menu: add `export` action to export a widget as a fragment file
|
||||
|
|
|
|||
|
|
@ -144,11 +144,23 @@ function startServerProcess() {
|
|||
|
||||
function stopServerProcess() {
|
||||
|
||||
if (serverProcess) serverProcess.kill()
|
||||
for (var w of [...clientWindows]) {
|
||||
if (w && !w.isDestroyed()) w.close()
|
||||
if (settings.read('no-gui')) {
|
||||
if (serverProcess) serverProcess.kill()
|
||||
return
|
||||
}
|
||||
|
||||
var toClose = [...clientWindows].filter(w=>w && !w.isDestroyed()),
|
||||
closed = 0
|
||||
for (var w of toClose) {
|
||||
w.on('closed', ()=>{
|
||||
closed++
|
||||
if (closed === toClose.length) {
|
||||
clientWindows = []
|
||||
if (serverProcess) serverProcess.kill()
|
||||
}
|
||||
})
|
||||
w.close()
|
||||
}
|
||||
clientWindows = []
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue