integrate deletion to collab sessions

This commit is contained in:
Ryan Di
2025-06-02 14:50:39 +10:00
parent f71c200106
commit 08a39e2034
8 changed files with 90 additions and 8 deletions
+7
View File
@@ -315,3 +315,10 @@ export const loadFilesFromFirebase = async (
return { loadedFiles, erroredFiles };
};
export const deleteRoomFromFirebase = async (
roomId: string,
roomKey: string,
): Promise<void> => {
// TODO: delete the room...
};
+8 -1
View File
@@ -119,6 +119,13 @@ export type SocketUpdateDataSource = {
username: string;
};
};
ROOM_DELETED: {
type: WS_SUBTYPES.DELETE;
payload: {
socketId: SocketId;
roomId: string;
};
};
};
export type SocketUpdateDataIncoming =
@@ -310,7 +317,7 @@ export const exportToBackend = async (
const response = await fetch(BACKEND_V2_POST, {
method: "POST",
body: payload.buffer,
body: new Uint8Array(payload.buffer),
});
const json = await response.json();
if (json.id) {
+1 -1
View File
@@ -186,7 +186,7 @@ class RoomManager {
return false;
}
const [, roomId] = match;
const roomId = match[1];
return rooms.some((room) => room.roomId === roomId);
} catch (error) {
console.warn("Failed to check room ownership:", error);