mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 03:14:39 +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() {
|
render() {
|
||||||
const errorAccounts = this.state.accounts.filter(a => a.syncState !== "running");
|
const errorAccounts = this.state.accounts.filter(a => a.hasSyncStateError());
|
||||||
if (errorAccounts.length === 1) {
|
if (errorAccounts.length === 1) {
|
||||||
const account = errorAccounts[0];
|
const account = errorAccounts[0];
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ class PreferencesAccountDetails extends Component {
|
||||||
}
|
}
|
||||||
_renderSyncErrorDetails() {
|
_renderSyncErrorDetails() {
|
||||||
const {account} = this.state;
|
const {account} = this.state;
|
||||||
if (account.syncState !== Account.SYNC_STATE_RUNNING) {
|
if (account.hasSyncStateError()) {
|
||||||
switch (account.syncState) {
|
switch (account.syncState) {
|
||||||
case Account.SYNC_STATE_AUTH_FAILED:
|
case Account.SYNC_STATE_AUTH_FAILED:
|
||||||
return this._renderErrorDetail(
|
return this._renderErrorDetail(
|
||||||
|
|
|
@ -26,7 +26,7 @@ class PreferencesAccountList extends Component {
|
||||||
_renderAccount = (account)=> {
|
_renderAccount = (account)=> {
|
||||||
const label = account.label;
|
const label = account.label;
|
||||||
const accountSub = `${account.name || 'No name provided'} <${account.emailAddress}>`;
|
const accountSub = `${account.name || 'No name provided'} <${account.emailAddress}>`;
|
||||||
const syncError = account.syncState !== Account.SYNC_STATE_RUNNING;
|
const syncError = account.hasSyncStateError();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -151,5 +151,9 @@ class Account extends ModelWithMetadata
|
||||||
else
|
else
|
||||||
archiveCategory
|
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
|
module.exports = Account
|
||||||
|
|
Loading…
Add table
Reference in a new issue