Fix bugs in dm tab

This commit is contained in:
Ajay Bura
2022-05-04 14:22:16 +05:30
parent b7c322d473
commit 06bae231ef
5 changed files with 86 additions and 110 deletions

View File

@@ -42,12 +42,15 @@ function Drawer() {
const [spaceId] = useSelectedSpace();
const [, forceUpdate] = useForceUpdate();
const scrollRef = useRef(null);
const { roomList } = initMatrix;
useEffect(() => {
const { roomList } = initMatrix;
roomList.on(cons.events.roomList.ROOMLIST_UPDATED, forceUpdate);
const handleUpdate = () => {
forceUpdate();
};
roomList.on(cons.events.roomList.ROOMLIST_UPDATED, handleUpdate);
return () => {
roomList.removeListener(cons.events.roomList.ROOMLIST_UPDATED, forceUpdate);
roomList.removeListener(cons.events.roomList.ROOMLIST_UPDATED, handleUpdate);
};
}, []);
@@ -68,7 +71,7 @@ function Drawer() {
{
selectedTab !== cons.tabs.DIRECTS
? <Home spaceId={spaceId} />
: <Directs />
: <Directs size={roomList.directs.size} />
}
</div>
</ScrollView>