mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +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
1 changed files with 5 additions and 3 deletions
|
@ -39,11 +39,13 @@ class NylasSyncStatusStore extends NylasStore
|
|||
|
||||
isSyncCompleteForAccount: (acctId, model) =>
|
||||
return false unless @_statesByAccount[acctId]
|
||||
return false if _.isEmpty(@_statesByAccount[acctId])
|
||||
if model
|
||||
return @_statesByAccount[acctId][model]?.complete ? false
|
||||
for _model in ModelsForSync
|
||||
modelState = @_statesByAccount[_model]
|
||||
return false if not modelState?.complete
|
||||
|
||||
for _model, modelState of @_statesByAccount
|
||||
continue unless _model in ModelsForSync
|
||||
return false if not modelState.complete
|
||||
return true
|
||||
|
||||
isSyncComplete: =>
|
||||
|
|
Loading…
Reference in a new issue