From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sat, 20 Aug 2022 15:21:37 +0000 (+0530) Subject: Update sidebar on room/space switch (#768) X-Git-Tag: v2.2.0~63 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=7e28aa1474ffc7a074e7d6e784d1dfcb22743c66;p=cinny.git Update sidebar on room/space switch (#768) * Select last room on space/tab change (#353) * Update sidbar on room select from search (#374) * Select last room on space/tab change (#353) * Update sidbar on room select from search (#374) * Fix wrong space gets selected with some rooms * Fix auto select room in categorized space * Fix room remain selected on leave * Fix leaved room appear in category & search * Remove globally exposed vars * Hide pin spaces from home * Fix selecting dm always open dm tab * Order category by AtoZ (#769) Co-authored-by: Krishan <33421343+kfiven@users.noreply.github.com> --- diff --git a/src/app/molecules/space-options/SpaceOptions.jsx b/src/app/molecules/space-options/SpaceOptions.jsx index 56fdfd3..0c166c6 100644 --- a/src/app/molecules/space-options/SpaceOptions.jsx +++ b/src/app/molecules/space-options/SpaceOptions.jsx @@ -38,10 +38,10 @@ function SpaceOptions({ roomId, afterOptionSelect }) { const handleMarkAsRead = () => { const spaceChildren = roomList.getCategorizedSpaces([roomId]); - spaceChildren?.forEach((childIds, spaceId) => { + spaceChildren?.forEach((childIds) => { childIds?.forEach((childId) => { markAsRead(childId); - }) + }); }); afterOptionSelect(); }; diff --git a/src/app/organisms/join-alias/JoinAlias.jsx b/src/app/organisms/join-alias/JoinAlias.jsx index 9e7f6df..bb90bf3 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 ca9ab6a..be5b345 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 && }