mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
Make sure draft has enough time to save before composer is closed
If the composer is closed too quickly, the DatabaseStore doesn't have enough time to trigger the necessary ActionBridge events that will properly save the draft. These events are triggered every 10 ms, so to be safe, we wait 15.
This commit is contained in:
parent
a728722f0f
commit
8e1aa4b371
1 changed files with 3 additions and 1 deletions
|
@ -177,7 +177,9 @@ class DraftStore
|
|||
# handler, so we need to always defer by one tick before re-firing close.
|
||||
Promise.settle(promises).then =>
|
||||
@_draftSessions = {}
|
||||
readyToUnload()
|
||||
# We have to wait for accumulateAndTrigger() in the DatabaseStore to
|
||||
# send events to ActionBridge before closing the window.
|
||||
setTimeout(readyToUnload, 15)
|
||||
|
||||
# Stop and wait before closing
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue