(feat): update room metadata
(qol): update todos
This commit is contained in:
parent
2d1e2c7bf8
commit
b49e96a458
5 changed files with 8 additions and 7 deletions
|
|
@ -48,7 +48,7 @@ function Overlay({
|
|||
user: User;
|
||||
participant: Participant;
|
||||
}) {
|
||||
const isAdmin = getRoomMetadata()?.admin === user.user_id;
|
||||
const isAdmin = getRoomMetadata()?.admins.includes(user.user_id) === true;
|
||||
const isDeafened = participant.attributes["deafened"] === "true";
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -470,12 +470,11 @@ function requireRuntime(runtime: Runtime | null): Runtime {
|
|||
|
||||
export function getRoomMetadata() {
|
||||
const roomMetadata = room.metadata;
|
||||
log(3, "call", "purple", "Room metadata:", { roomMetadata });
|
||||
try {
|
||||
const data = JSON.parse(roomMetadata || '{"admin": 0}');
|
||||
return data as { admin: number };
|
||||
const data = JSON.parse(roomMetadata || '{"admins": []}');
|
||||
return data as { admins: number[] };
|
||||
} catch {
|
||||
return { admin: 0 };
|
||||
return { admins: [] };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,3 +8,6 @@
|
|||
- Save call invite in `calls` array
|
||||
- Sounds
|
||||
- Fullscreen button for screenshares
|
||||
- Admin call actions
|
||||
- Timeout
|
||||
- Disconnect
|
||||
|
|
|
|||
1
packages/chat/todo.md
Normal file
1
packages/chat/todo.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Mobile message box broken
|
||||
2
todo.md
2
todo.md
|
|
@ -1,2 +0,0 @@
|
|||
- Handle live messages in notification context
|
||||
- Mobile message box broken
|
||||
Loading…
Reference in a new issue