diff --git a/src/flux/stores/task-queue.coffee b/src/flux/stores/task-queue.coffee index e8d0b7f8d..cf4858142 100644 --- a/src/flux/stores/task-queue.coffee +++ b/src/flux/stores/task-queue.coffee @@ -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 )