mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-25 17:42:16 +08:00
fix(data-source): Wait until the next cycle to cleanup
Fixes a crash when switching to the thread list from the draft list, where there are very briefly zero observers.
This commit is contained in:
parent
1e9d1dff07
commit
c222fa0c39
1 changed files with 4 additions and 3 deletions
|
@ -26,9 +26,10 @@ class ListDataSource
|
|||
|
||||
return =>
|
||||
@_emitter.removeListener('trigger', eventHandler)
|
||||
if @_emitter.listenerCount('trigger') is 0
|
||||
@_cleanedup = true
|
||||
@cleanup()
|
||||
process.nextTick =>
|
||||
if @_emitter.listenerCount('trigger') is 0
|
||||
@_cleanedup = true
|
||||
@cleanup()
|
||||
|
||||
loaded: ->
|
||||
throw new Error("ListDataSource base class does not implement loaded()")
|
||||
|
|
Loading…
Reference in a new issue