mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-20 23:36:21 +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
|
@ -137,8 +137,8 @@ class ActionBridge
|
||||||
# Electron won't actually send the message. To work around this, we wait an
|
# 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
|
# arbitrary amount of time before closing the window after the last IPC event
|
||||||
# was sent. https://github.com/atom/electron/issues/4366
|
# was sent. https://github.com/atom/electron/issues/4366
|
||||||
if @ipcLastSendTime and Date.now() - @ipcLastSendTime < 50
|
if @ipcLastSendTime and Date.now() - @ipcLastSendTime < 100
|
||||||
setTimeout(readyToUnload, 50)
|
setTimeout(readyToUnload, 100)
|
||||||
return false
|
return false
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ class DraftChangeSet
|
||||||
@add(changes, {doesNotAffectPristine: true})
|
@add(changes, {doesNotAffectPristine: true})
|
||||||
|
|
||||||
commit: ({noSyncback}={}) =>
|
commit: ({noSyncback}={}) =>
|
||||||
|
clearTimeout(@_timer) if @_timer
|
||||||
@_commitChain = @_commitChain.finally =>
|
@_commitChain = @_commitChain.finally =>
|
||||||
if Object.keys(@_pending).length is 0
|
if Object.keys(@_pending).length is 0
|
||||||
return Promise.resolve(true)
|
return Promise.resolve(true)
|
||||||
|
|
Loading…
Reference in a new issue