From 477d5ac0dcc612202fba4b04d10da290c479a468 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 11 Feb 2019 13:31:27 +0000 Subject: [PATCH] View welcome behind modals when not showing logged in view --- src/components/structures/MatrixChat.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 1453007b18..7c03aaec57 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -574,11 +574,8 @@ export default React.createClass({ const UserSettingsDialog = sdk.getComponent("dialogs.UserSettingsDialog"); Modal.createTrackedDialog('User settings', '', UserSettingsDialog, {}, 'mx_SettingsDialog'); - // View the home page if we need something to look at - if (!this.state.currentGroupId && !this.state.currentRoomId) { - this._setPage(PageTypes.HomePage); - this.notifyNewScreen('home'); - } + // View the welcome or home page if we need something to look at + this._viewSomethingBehindModal(); break; } case 'view_create_room': @@ -595,11 +592,8 @@ export default React.createClass({ config: this.props.config, }, 'mx_RoomDirectory_dialogWrapper'); - // View the home page if we need something to look at - if (!this.state.currentGroupId && !this.state.currentRoomId) { - this._setPage(PageTypes.HomePage); - this.notifyNewScreen('home'); - } + // View the welcome or home page if we need something to look at + this._viewSomethingBehindModal(); } break; case 'view_my_groups': @@ -887,6 +881,16 @@ export default React.createClass({ this.notifyNewScreen('group/' + groupId); }, + _viewSomethingBehindModal() { + if (this.state.view !== VIEWS.LOGGED_IN) { + this._viewWelcome(); + return; + } + if (!this.state.currentGroupId && !this.state.currentRoomId) { + this._viewHome(); + } + }, + _viewWelcome() { this.setStateForNewView({ view: VIEWS.WELCOME,