mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-26 10:00:50 +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 =>
|
return =>
|
||||||
@_emitter.removeListener('trigger', eventHandler)
|
@_emitter.removeListener('trigger', eventHandler)
|
||||||
if @_emitter.listenerCount('trigger') is 0
|
process.nextTick =>
|
||||||
@_cleanedup = true
|
if @_emitter.listenerCount('trigger') is 0
|
||||||
@cleanup()
|
@_cleanedup = true
|
||||||
|
@cleanup()
|
||||||
|
|
||||||
loaded: ->
|
loaded: ->
|
||||||
throw new Error("ListDataSource base class does not implement loaded()")
|
throw new Error("ListDataSource base class does not implement loaded()")
|
||||||
|
|
Loading…
Reference in a new issue