correctly wait for catchup sync

This commit is contained in:
Bruno Windels 2020-05-04 19:38:23 +02:00
parent 225fe873be
commit 1fa14a99e9
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ export class SessionLoadViewModel extends ViewModel {
this.emitChange(); this.emitChange();
// wait for initial sync, but not catchup sync // wait for initial sync, but not catchup sync
const isCatchupSync = s === LoadStatus.FirstSync && const isCatchupSync = s === LoadStatus.FirstSync &&
this._sessionContainer.sync.status === SyncStatus.CatchupSync; this._sessionContainer.sync.status.get() === SyncStatus.CatchupSync;
return isCatchupSync || return isCatchupSync ||
s === LoadStatus.LoginFailed || s === LoadStatus.LoginFailed ||
s === LoadStatus.Error || s === LoadStatus.Error ||

View file

@ -159,8 +159,8 @@ export class SessionContainer {
async _waitForFirstSync() { async _waitForFirstSync() {
try { try {
this._status.set(LoadStatus.FirstSync);
this._sync.start(); this._sync.start();
this._status.set(LoadStatus.FirstSync);
} catch (err) { } catch (err) {
// swallow ConnectionError here and continue, // swallow ConnectionError here and continue,
// as the reconnector above will call // as the reconnector above will call