Go to welcome on logout (#33306)

* Go to welcome on logout

Instead of login, for QR login project

* Update tests

* Add tests

* Delint

* Update comments
This commit is contained in:
Michael Telatynski
2026-04-28 10:24:47 +00:00
committed by GitHub
parent c363d2eb82
commit 5f770bfe4c
8 changed files with 45 additions and 26 deletions
@@ -422,7 +422,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
this.onShowPostLoginScreen();
}
const promisesList: Promise<any>[] = [this.firstSyncPromise.promise];
const promisesList: Promise<unknown>[] = [this.firstSyncPromise.promise];
let crossSigningIsSetUp = false;
if (cryptoEnabled) {
// check if the user has previously published public cross-signing keys,
@@ -1101,17 +1101,18 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
}
}
private viewWelcome(): void {
private viewWelcome(otherState?: Partial<IState>): void {
if (shouldUseLoginForWelcome(SdkConfig.get())) {
return this.viewLogin();
return this.viewLogin(otherState);
}
this.setStateForNewView({
view: Views.WELCOME,
...otherState,
});
this.notifyNewScreen("welcome");
}
private viewLogin(otherState?: any): void {
private viewLogin(otherState?: Partial<IState>): void {
this.setStateForNewView({
view: Views.LOGIN,
...otherState,
@@ -1555,7 +1556,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
* Called when the session is logged out
*/
private onLoggedOut(): void {
this.viewLogin({
this.viewWelcome({
ready: false,
collapseLhs: false,
currentRoomId: null,