From fcf4ced282054558837122c4a7f234c0e7d9b345 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:47:23 -0400 Subject: [PATCH] remove old chatbox --- worker/TldrawDurableObject.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/worker/TldrawDurableObject.ts b/worker/TldrawDurableObject.ts index fa8b69d..962c67f 100644 --- a/worker/TldrawDurableObject.ts +++ b/worker/TldrawDurableObject.ts @@ -100,9 +100,13 @@ export class TldrawDurableObject { const initialSnapshot = roomFromBucket ? ((await roomFromBucket.json()) as RoomSnapshot) : undefined - console.log("room data", roomFromBucket) - const serializedRoom = JSON.stringify(initialSnapshot, null, 2) - console.log("serialized room", serializedRoom) + if (initialSnapshot) { + for (const record of initialSnapshot?.documents) { + if (record.state.typeName === "chatBox") { + console.log("chatbox", record) + } + } + } // create a new TLSocketRoom. This handles all the sync protocol & websocket connections. // it's up to us to persist the room state to R2 when needed though. return new TLSocketRoom({