From ba37b3047e8b68c033de0306b739275590b4b817 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Fri, 19 Aug 2022 18:35:38 +0530 Subject: [PATCH] Select last room on space/tab change (#353) --- src/app/organisms/join-alias/JoinAlias.jsx | 4 +- .../organisms/navigation/DrawerBreadcrumb.jsx | 7 +- src/client/action/navigation.js | 8 + src/client/initMatrix.js | 7 + src/client/state/navigation.js | 144 ++++++++++++++---- 5 files changed, 137 insertions(+), 33 deletions(-) diff --git a/src/app/organisms/join-alias/JoinAlias.jsx b/src/app/organisms/join-alias/JoinAlias.jsx index 9e7f6df1..bb90bf35 100644 --- a/src/app/organisms/join-alias/JoinAlias.jsx +++ b/src/app/organisms/join-alias/JoinAlias.jsx @@ -6,7 +6,7 @@ import initMatrix from '../../../client/initMatrix'; import cons from '../../../client/state/cons'; import navigation from '../../../client/state/navigation'; import { join } from '../../../client/action/room'; -import { selectRoom, selectSpace } from '../../../client/action/navigation'; +import { selectRoom, selectTab } from '../../../client/action/navigation'; import Text from '../../atoms/text/Text'; import IconButton from '../../atoms/button/IconButton'; @@ -32,7 +32,7 @@ function JoinAliasContent({ term, requestClose }) { const openRoom = (roomId) => { const room = mx.getRoom(roomId); if (!room) return; - if (room.isSpaceRoom()) selectSpace(roomId); + if (room.isSpaceRoom()) selectTab(roomId); else selectRoom(roomId); requestClose(); }; diff --git a/src/app/organisms/navigation/DrawerBreadcrumb.jsx b/src/app/organisms/navigation/DrawerBreadcrumb.jsx index ca9ab6a0..be5b345b 100644 --- a/src/app/organisms/navigation/DrawerBreadcrumb.jsx +++ b/src/app/organisms/navigation/DrawerBreadcrumb.jsx @@ -6,7 +6,7 @@ import { twemojify } from '../../../util/twemojify'; import initMatrix from '../../../client/initMatrix'; import cons from '../../../client/state/cons'; -import { selectSpace } from '../../../client/action/navigation'; +import { selectTab, selectSpace } from '../../../client/action/navigation'; import navigation from '../../../client/state/navigation'; import { abbreviateNumber } from '../../../util/common'; @@ -107,7 +107,10 @@ function DrawerBreadcrumb({ spaceId }) { { index !== 0 && }