Fix space add options visible in home
authorAjay Bura <ajbura@gmail.com>
Wed, 23 Feb 2022 14:18:24 +0000 (19:48 +0530)
committerAjay Bura <ajbura@gmail.com>
Wed, 23 Feb 2022 14:18:24 +0000 (19:48 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/organisms/navigation/Drawer.jsx
src/app/organisms/navigation/DrawerBreadcrumb.jsx
src/client/state/navigation.js

index e5b9a25459eb148f5e6228c32e5250d93f386dff..10b047f0d161dab0b92e18dad3c2f76fe5f84445 100644 (file)
@@ -4,7 +4,6 @@ import './Drawer.scss';
 import initMatrix from '../../../client/initMatrix';
 import cons from '../../../client/state/cons';
 import navigation from '../../../client/state/navigation';
-import { selectTab, selectSpace } from '../../../client/action/navigation';
 
 import Text from '../../atoms/text/Text';
 import ScrollView from '../../atoms/scroll/ScrollView';
@@ -52,7 +51,7 @@ function Drawer() {
     <div className="drawer">
       <DrawerHeader selectedTab={selectedTab} spaceId={spaceId} />
       <div className="drawer__content-wrapper">
-        {selectedTab !== cons.tabs.DIRECTS && <DrawerBreadcrumb spaceId={spaceId} />}
+        {navigation.selectedSpacePath.length > 1 && <DrawerBreadcrumb spaceId={spaceId} />}
         <div className="rooms__wrapper">
           <ScrollView ref={scrollRef} autoHide>
             <div className="rooms-container">
index c221827483d6158ea4d3e2719e14ac26de334f9b..61d8d08142944738842f65f42c0feacadd2935f2 100644 (file)
@@ -48,8 +48,6 @@ function DrawerBreadcrumb({ spaceId }) {
     };
   }, [spaceId]);
 
-  if (spacePath.length === 1) return null;
-
   function getHomeNotiExcept(childId) {
     const orphans = roomList.getOrphans();
     const childIndex = orphans.indexOf(childId);
index 91fca2daff3b9d0561ebcaaf99aad6c3593b41d2..ca0839563fe11c6cf0e0a2bd225a301716f82155 100644 (file)
@@ -69,7 +69,7 @@ class Navigation extends EventEmitter {
       },
       [cons.actions.navigation.SELECT_SPACE]: () => {
         this._setSpacePath(action.roomId);
-        this.selectedSpaceId = action.roomId;
+        this.selectedSpaceId = action.roomId === cons.tabs.HOME ? null : action.roomId;
         this.emit(cons.events.navigation.SPACE_SELECTED, this.selectedSpaceId);
       },
       [cons.actions.navigation.SELECT_ROOM]: () => {