Added space nesting (#52)

This commit is contained in:
unknown 2021-09-03 17:58:01 +05:30
parent 6c1a602bdc
commit 4efc320f23
18 changed files with 368 additions and 91 deletions

View file

@ -17,13 +17,13 @@ function Directs() {
const [, forceUpdate] = useState({});
function selectorChanged(activeRoomID, prevActiveRoomId) {
function selectorChanged(selectedRoomId, prevSelectedRoomId) {
if (!drawerPostie.hasTopic('selector-change')) return;
const addresses = [];
if (drawerPostie.hasSubscriber('selector-change', activeRoomID)) addresses.push(activeRoomID);
if (drawerPostie.hasSubscriber('selector-change', prevActiveRoomId)) addresses.push(prevActiveRoomId);
if (drawerPostie.hasSubscriber('selector-change', selectedRoomId)) addresses.push(selectedRoomId);
if (drawerPostie.hasSubscriber('selector-change', prevSelectedRoomId)) addresses.push(prevSelectedRoomId);
if (addresses.length === 0) return;
drawerPostie.post('selector-change', addresses, activeRoomID);
drawerPostie.post('selector-change', addresses, selectedRoomId);
}
function unreadChanged(roomId) {
@ -35,9 +35,9 @@ function Directs() {
function roomListUpdated() {
const { spaces, rooms, directs } = initMatrix.roomList;
if (!(
spaces.has(navigation.getActiveRoomId())
|| rooms.has(navigation.getActiveRoomId())
|| directs.has(navigation.getActiveRoomId()))
spaces.has(navigation.selectedRoomId)
|| rooms.has(navigation.selectedRoomId)
|| directs.has(navigation.selectedRoomId))
) {
selectRoom(null);
}
@ -62,6 +62,7 @@ function Directs() {
key={id}
roomId={id}
drawerPostie={drawerPostie}
onClick={() => selectRoom(id)}
/>
));
}