diff --git a/src/SyncGate.tsx b/src/SyncGate.tsx index 5bafc63..d849e7e 100644 --- a/src/SyncGate.tsx +++ b/src/SyncGate.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { connect } from 'react-redux'; +import { Action } from 'redux-actions'; import { Route, Switch, Redirect, RouteComponentProps, withRouter } from 'react-router'; import { List, Map } from 'immutable'; @@ -113,8 +114,12 @@ class SyncGate extends React.PureComponent { const journal = new EteSync.Journal(); const cryptoManager = new EteSync.CryptoManager(this.props.etesync.encryptionKey, collection.uid); journal.setInfo(cryptoManager, collection); - store.dispatch(createJournal(this.props.etesync, journal)).then(() => { - store.dispatch(fetchEntries(this.props.etesync, collection.uid)); + store.dispatch(createJournal(this.props.etesync, journal)).then( + (journalAction: Action) => { + // FIXME: Limit based on error code to only do it for associates. + if (!journalAction.error) { + store.dispatch(fetchEntries(this.props.etesync, collection.uid)); + } }); }); });