Fix font not resetting when logging out (#8670)
* Fix font not resetting when logging out * Adopt on_logged_in and on_logged_out into DispatcherAction * Add tests * Add copyright
This commit is contained in:
committed by
GitHub
parent
f3b762c1a8
commit
d75e2f19c5
@@ -71,7 +71,7 @@ class LifecycleStore extends Store<ActionPayload> {
|
||||
break;
|
||||
}
|
||||
case 'on_client_not_viable':
|
||||
case 'on_logged_out':
|
||||
case Action.OnLoggedOut:
|
||||
this.reset();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { EventEmitter } from "events";
|
||||
import { MatrixClientPeg } from "../MatrixClientPeg";
|
||||
import { ActionPayload } from "../dispatcher/payloads";
|
||||
import { IDestroyable } from "../utils/IDestroyable";
|
||||
import { Action } from "../dispatcher/actions";
|
||||
|
||||
export abstract class ReadyWatchingStore extends EventEmitter implements IDestroyable {
|
||||
protected matrixClient: MatrixClient;
|
||||
@@ -83,7 +84,7 @@ export abstract class ReadyWatchingStore extends EventEmitter implements IDestro
|
||||
this.matrixClient = payload.matrixClient;
|
||||
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 === Action.OnLoggedOut) {
|
||||
if (this.matrixClient) {
|
||||
await this.onNotReady();
|
||||
this.matrixClient = null;
|
||||
|
||||
@@ -241,7 +241,7 @@ export class RoomViewStore extends Store<ActionPayload> {
|
||||
break;
|
||||
}
|
||||
case 'on_client_not_viable':
|
||||
case 'on_logged_out':
|
||||
case Action.OnLoggedOut:
|
||||
this.reset();
|
||||
break;
|
||||
case 'reply_to_event':
|
||||
|
||||
Reference in New Issue
Block a user