Remove public rooms
This commit is contained in:
parent
ca18873a1b
commit
0e407c08df
2 changed files with 0 additions and 29 deletions
3
.env
3
.env
|
@ -7,9 +7,6 @@
|
||||||
# Used for determining the homeserver to use for short urls etc.
|
# Used for determining the homeserver to use for short urls etc.
|
||||||
# VITE_DEFAULT_HOMESERVER=http://localhost:8008
|
# VITE_DEFAULT_HOMESERVER=http://localhost:8008
|
||||||
|
|
||||||
# The room id for the space to use for listing public group call rooms
|
|
||||||
# VITE_PUBLIC_SPACE_ROOM_ID=!hjdfshkdskjdsk:myhomeserver.com
|
|
||||||
|
|
||||||
# The Sentry DSN to use for error reporting. Leave undefined to disable.
|
# The Sentry DSN to use for error reporting. Leave undefined to disable.
|
||||||
# VITE_SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0
|
# VITE_SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0
|
||||||
|
|
||||||
|
|
|
@ -376,32 +376,6 @@ export function useGroupCallRooms(client) {
|
||||||
return rooms;
|
return rooms;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function usePublicRooms(client, publicSpaceRoomId, maxRooms = 50) {
|
|
||||||
const [rooms, setRooms] = useState([]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (publicSpaceRoomId) {
|
|
||||||
client.getRoomHierarchy(publicSpaceRoomId, maxRooms).then(({ rooms }) => {
|
|
||||||
const filteredRooms = rooms
|
|
||||||
.filter((room) => room.room_type !== "m.space")
|
|
||||||
.map((room) => ({
|
|
||||||
roomId: room.room_alias || room.room_id,
|
|
||||||
roomName: room.name,
|
|
||||||
avatarUrl: null,
|
|
||||||
room,
|
|
||||||
participants: [],
|
|
||||||
}));
|
|
||||||
|
|
||||||
setRooms(filteredRooms);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setRooms([]);
|
|
||||||
}
|
|
||||||
}, [publicSpaceRoomId]);
|
|
||||||
|
|
||||||
return rooms;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getRoomUrl(roomId) {
|
export function getRoomUrl(roomId) {
|
||||||
if (roomId.startsWith("#")) {
|
if (roomId.startsWith("#")) {
|
||||||
const [localPart, host] = roomId.replace("#", "").split(":");
|
const [localPart, host] = roomId.replace("#", "").split(":");
|
||||||
|
|
Loading…
Add table
Reference in a new issue