From 178a329e45752d313100b567da40feb1d60d1207 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:55:35 -0400 Subject: [PATCH] update --- worker/TldrawDurableObject.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/worker/TldrawDurableObject.ts b/worker/TldrawDurableObject.ts index 962c67f..11bd786 100644 --- a/worker/TldrawDurableObject.ts +++ b/worker/TldrawDurableObject.ts @@ -95,17 +95,15 @@ export class TldrawDurableObject { this.roomPromise = (async () => { // fetch the room from R2 const roomFromBucket = await this.r2.get(`rooms/${roomId}`) - + console.log("we are in a room") // if it doesn't exist, we'll just create a new empty room const initialSnapshot = roomFromBucket ? ((await roomFromBucket.json()) as RoomSnapshot) : undefined if (initialSnapshot) { - for (const record of initialSnapshot?.documents) { - if (record.state.typeName === "chatBox") { - console.log("chatbox", record) - } - } + initialSnapshot?.documents.slice(0, 10).forEach(record => { + console.log("record", 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.