From a4b12d52a108c33291bbb263b8a67028b09ae355 Mon Sep 17 00:00:00 2001 From: ebifrier Date: Mon, 20 Apr 2020 21:21:35 +0900 Subject: [PATCH 1/2] Detach all engines when the window closed --- src/components/App.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/App.js b/src/components/App.js index 19721596c..5234a25b7 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -181,11 +181,16 @@ class App extends Component { evt.returnValue = ' ' - setTimeout(() => { + setTimeout(async () => { if (sabaki.askForSave()) { + let promise = sabaki.detachEngines( + this.state.attachedEngineSyncers.map(syncer => syncer.id) + ) + gtplogger.close() this.closeWindow = true sabaki.window.close() + await promise } }) }) From 49b32a9f161020f9b36cbaabe524658949e743cc Mon Sep 17 00:00:00 2001 From: ebifrier Date: Mon, 20 Apr 2020 23:30:48 +0900 Subject: [PATCH 2/2] Remove await --- src/components/App.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 5234a25b7..be22cfddf 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -181,16 +181,15 @@ class App extends Component { evt.returnValue = ' ' - setTimeout(async () => { + setTimeout(() => { if (sabaki.askForSave()) { - let promise = sabaki.detachEngines( + sabaki.detachEngines( this.state.attachedEngineSyncers.map(syncer => syncer.id) ) gtplogger.close() this.closeWindow = true sabaki.window.close() - await promise } }) })