Fix crash on logging in again after soft logout
Fixes https://github.com/vector-im/riot-web/issues/14834
This commit is contained in:
parent
b1f8fe40d6
commit
9d247321f5
2 changed files with 1 additions and 6 deletions
|
@ -35,11 +35,6 @@ export abstract class AsyncStoreWithClient<T extends Object> extends AsyncStore<
|
||||||
await this.onAction(payload);
|
await this.onAction(payload);
|
||||||
|
|
||||||
if (payload.action === 'MatrixActions.sync') {
|
if (payload.action === 'MatrixActions.sync') {
|
||||||
// Filter out anything that isn't the first PREPARED sync.
|
|
||||||
if (!(payload.prevState === 'PREPARED' && payload.state !== 'PREPARED')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.matrixClient = payload.matrixClient;
|
this.matrixClient = payload.matrixClient;
|
||||||
await this.onReady();
|
await this.onReady();
|
||||||
} else if (payload.action === 'on_client_not_viable' || payload.action === 'on_logged_out') {
|
} else if (payload.action === 'on_client_not_viable' || payload.action === 'on_logged_out') {
|
||||||
|
|
|
@ -55,7 +55,7 @@ export class BreadcrumbsStore extends AsyncStoreWithClient<IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private get meetsRoomRequirement(): boolean {
|
private get meetsRoomRequirement(): boolean {
|
||||||
return this.matrixClient.getVisibleRooms().length >= 20;
|
return this.matrixClient && this.matrixClient.getVisibleRooms().length >= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async onAction(payload: ActionPayload) {
|
protected async onAction(payload: ActionPayload) {
|
||||||
|
|
Loading…
Reference in a new issue