From 32e127e09880104b5a327f42bb81e3650db1995a Mon Sep 17 00:00:00 2001 From: Johannes Krude Date: Fri, 18 Feb 2022 09:43:19 +0100 Subject: [PATCH] Add `#/dm` command to be used as a link in custom `home.html` (#7783) --- src/components/structures/MatrixChat.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 3a52f9cb38f..bd05a677c78 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -673,6 +673,9 @@ export default class MatrixChat extends React.PureComponent { } case 'view_create_room': this.createRoom(payload.public, payload.defaultName); + + // View the welcome or home page if we need something to look at + this.viewSomethingBehindModal(); break; case 'view_create_group': { const prototype = SettingsStore.getValue("feature_communities_v2_prototypes"); @@ -710,6 +713,9 @@ export default class MatrixChat extends React.PureComponent { break; case 'view_create_chat': showStartChatInviteDialog(payload.initialText || ""); + + // View the welcome or home page if we need something to look at + this.viewSomethingBehindModal(); break; case 'view_invite': { const room = MatrixClientPeg.get().getRoom(payload.roomId); @@ -1696,6 +1702,10 @@ export default class MatrixChat extends React.PureComponent { dis.dispatch({ action: 'view_create_room', }); + } else if (screen === 'dm') { + dis.dispatch({ + action: 'view_create_chat', + }); } else if (screen === 'settings') { dis.fire(Action.ViewUserSettings); } else if (screen === 'welcome') {