Fix public room showing leaved room as joined
authorAjay Bura <ajbura@gmail.com>
Wed, 4 May 2022 09:24:43 +0000 (14:54 +0530)
committerAjay Bura <ajbura@gmail.com>
Wed, 4 May 2022 09:24:43 +0000 (14:54 +0530)
src/app/organisms/public-rooms/PublicRooms.jsx

index 467f38d5fe05072a0dc1e95715de40670235193e..d1674c32fcd82910430067d8e56ac8f54f59e6ea 100644 (file)
@@ -195,7 +195,7 @@ function PublicRooms({ isOpen, searchTerm, onRequestClose }) {
     return rooms.map((room) => {
       const alias = typeof room.canonical_alias === 'string' ? room.canonical_alias : room.room_id;
       const name = typeof room.name === 'string' ? room.name : alias;
-      const isJoined = initMatrix.matrixClient.getRoom(room.room_id) !== null;
+      const isJoined = initMatrix.matrixClient.getRoom(room.room_id)?.getMyMembership() === 'join';
       return (
         <RoomTile
           key={room.room_id}