From b77c2df2be1569b08b44a8d6968bc1bdcbd19c92 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 21 Feb 2020 14:40:42 +0000 Subject: [PATCH 1/2] Fix theme being overridden to light even after login is completed Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 1 + src/theme.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 229c741310..cdd4625dbf 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -674,6 +674,7 @@ export default createReactClass({ this.state.view !== VIEWS.E2E_SETUP ) { this._onLoggedIn(); + ThemeController.isLogin = false; } break; case 'on_client_not_viable': diff --git a/src/theme.js b/src/theme.js index 774148dacd..442a89e25f 100644 --- a/src/theme.js +++ b/src/theme.js @@ -70,7 +70,7 @@ export class ThemeWatcher { } }; - // XXX: forceTheme param aded here as local echo appears to be unreliable + // XXX: forceTheme param added here as local echo appears to be unreliable // https://github.com/vector-im/riot-web/issues/11443 recheck(forceTheme) { const oldTheme = this._currentTheme; From 4ed4d91b48450f3721a7334588429c65cd1e6045 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 21 Feb 2020 14:54:56 +0000 Subject: [PATCH 2/2] move to a more reusable code path Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index cdd4625dbf..de916ad7aa 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -674,7 +674,6 @@ export default createReactClass({ this.state.view !== VIEWS.E2E_SETUP ) { this._onLoggedIn(); - ThemeController.isLogin = false; } break; case 'on_client_not_viable': @@ -1176,6 +1175,7 @@ export default createReactClass({ * Called when a new logged in session has started */ _onLoggedIn: async function() { + ThemeController.isLogin = false; this.setStateForNewView({ view: VIEWS.LOGGED_IN }); if (MatrixClientPeg.currentUserIsJustRegistered()) { MatrixClientPeg.setJustRegisteredUserId(null);