mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-13 11:38:31 +08:00
fix(unload): safely unload the task queue on quit
This commit is contained in:
parent
9ec3daff0a
commit
ce05e94aeb
1 changed files with 6 additions and 1 deletions
|
@ -73,9 +73,14 @@ class TaskQueue
|
|||
|
||||
@_restoreQueue()
|
||||
|
||||
@_savedOnUnload = false
|
||||
NylasEnv.onBeforeUnload((finishUnload) =>
|
||||
if @_savedOnUnload then return true
|
||||
@_saveQueue()
|
||||
.finally(finishUnload)
|
||||
.finally(() =>
|
||||
@_savedOnUnload = true
|
||||
finishUnload()
|
||||
)
|
||||
return false
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue