mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
fix(drafts): only syncback every 30 seconds instead of 5 seconds
This will help prevent API errors from causing multiple drafts to appear
This commit is contained in:
parent
e0180a1e12
commit
1febd56ed5
|
@ -41,11 +41,11 @@ describe "DraftChangeSet", ->
|
|||
expect(@changeSet.commit).toHaveBeenCalled()
|
||||
|
||||
describe "otherwise", ->
|
||||
it "should commit after five seconds", ->
|
||||
it "should commit after thirty seconds", ->
|
||||
spyOn(@changeSet, 'commit')
|
||||
@changeSet.add({body: 'Hello World!'})
|
||||
expect(@changeSet.commit).not.toHaveBeenCalled()
|
||||
advanceClock(6000)
|
||||
advanceClock(31000)
|
||||
expect(@changeSet.commit).toHaveBeenCalled()
|
||||
|
||||
describe "commit", ->
|
||||
|
|
|
@ -44,7 +44,7 @@ class DraftChangeSet
|
|||
@commit()
|
||||
else
|
||||
clearTimeout(@_timer) if @_timer
|
||||
@_timer = setTimeout(@commit, 5000)
|
||||
@_timer = setTimeout(@commit, 30000)
|
||||
|
||||
# If force is true, then we'll always run the `_onCommit` callback
|
||||
# regardless if there are _pending changes or not
|
||||
|
|
Loading…
Reference in a new issue