mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
fix(sync-status): Actually fix sync status logic
- Must take into account that some accounts have `labels` and others have `folders`
This commit is contained in:
parent
cef7809bd6
commit
7d2bf7bed5
|
@ -39,11 +39,13 @@ class NylasSyncStatusStore extends NylasStore
|
||||||
|
|
||||||
isSyncCompleteForAccount: (acctId, model) =>
|
isSyncCompleteForAccount: (acctId, model) =>
|
||||||
return false unless @_statesByAccount[acctId]
|
return false unless @_statesByAccount[acctId]
|
||||||
|
return false if _.isEmpty(@_statesByAccount[acctId])
|
||||||
if model
|
if model
|
||||||
return @_statesByAccount[acctId][model]?.complete ? false
|
return @_statesByAccount[acctId][model]?.complete ? false
|
||||||
for _model in ModelsForSync
|
|
||||||
modelState = @_statesByAccount[_model]
|
for _model, modelState of @_statesByAccount
|
||||||
return false if not modelState?.complete
|
continue unless _model in ModelsForSync
|
||||||
|
return false if not modelState.complete
|
||||||
return true
|
return true
|
||||||
|
|
||||||
isSyncComplete: =>
|
isSyncComplete: =>
|
||||||
|
|
Loading…
Reference in a new issue