mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 10:38:11 +08:00
fix(sync-state): ignore Account.syncState=="stopped" for now
Valid accounts that are syncing properly can reviece a delta for Account.syncState==stopped currently, due to some quirks in the backend. Ignore "stopped" until it unabiguously represents an error state.
This commit is contained in:
parent
e0db484276
commit
3af91d22b6
4 changed files with 7 additions and 3 deletions
|
@ -55,7 +55,7 @@ export default class AccountErrorHeader extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const errorAccounts = this.state.accounts.filter(a => a.syncState !== "running");
|
||||
const errorAccounts = this.state.accounts.filter(a => a.hasSyncStateError());
|
||||
if (errorAccounts.length === 1) {
|
||||
const account = errorAccounts[0];
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ class PreferencesAccountDetails extends Component {
|
|||
}
|
||||
_renderSyncErrorDetails() {
|
||||
const {account} = this.state;
|
||||
if (account.syncState !== Account.SYNC_STATE_RUNNING) {
|
||||
if (account.hasSyncStateError()) {
|
||||
switch (account.syncState) {
|
||||
case Account.SYNC_STATE_AUTH_FAILED:
|
||||
return this._renderErrorDetail(
|
||||
|
|
|
@ -26,7 +26,7 @@ class PreferencesAccountList extends Component {
|
|||
_renderAccount = (account)=> {
|
||||
const label = account.label;
|
||||
const accountSub = `${account.name || 'No name provided'} <${account.emailAddress}>`;
|
||||
const syncError = account.syncState !== Account.SYNC_STATE_RUNNING;
|
||||
const syncError = account.hasSyncStateError();
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
|
@ -151,5 +151,9 @@ class Account extends ModelWithMetadata
|
|||
else
|
||||
archiveCategory
|
||||
|
||||
hasSyncStateError: ->
|
||||
# TODO: ignoring "stopped" until it's no longer overloaded on API
|
||||
return @syncState != Account.SYNC_STATE_RUNNING &&
|
||||
@syncState != Account.SYNC_STATE_STOPPED
|
||||
|
||||
module.exports = Account
|
||||
|
|
Loading…
Reference in a new issue