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:
Drew Regitsky 2016-03-18 10:41:08 -07:00
parent e0db484276
commit 3af91d22b6
4 changed files with 7 additions and 3 deletions

View file

@ -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];

View file

@ -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(

View file

@ -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

View file

@ -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