mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-29 03:17:47 +08:00
fix(composer): Prevent composers in different windows to be out of sync
- Increase arbitrary wait time before closing window so Database ipc messages can reach other windows with a higer success rate -- this caused composers in different windows to be out of sync fairly often because the database trigger event never reached them - Clears commit timeout when commiting
This commit is contained in:
parent
3b21982af2
commit
b427949288
2 changed files with 3 additions and 2 deletions
|
@ -137,8 +137,8 @@ class ActionBridge
|
|||
# Electron won't actually send the message. To work around this, we wait an
|
||||
# arbitrary amount of time before closing the window after the last IPC event
|
||||
# was sent. https://github.com/atom/electron/issues/4366
|
||||
if @ipcLastSendTime and Date.now() - @ipcLastSendTime < 50
|
||||
setTimeout(readyToUnload, 50)
|
||||
if @ipcLastSendTime and Date.now() - @ipcLastSendTime < 100
|
||||
setTimeout(readyToUnload, 100)
|
||||
return false
|
||||
return true
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ class DraftChangeSet
|
|||
@add(changes, {doesNotAffectPristine: true})
|
||||
|
||||
commit: ({noSyncback}={}) =>
|
||||
clearTimeout(@_timer) if @_timer
|
||||
@_commitChain = @_commitChain.finally =>
|
||||
if Object.keys(@_pending).length is 0
|
||||
return Promise.resolve(true)
|
||||
|
|
Loading…
Reference in a new issue