From d7f4d61b55d5fc31b896b7fb588c74c62d2b1571 Mon Sep 17 00:00:00 2001 From: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:12:31 -0500 Subject: [PATCH] fix local IP for dev, fix broadcast view --- src/ui/overrides.tsx | 15 ++++++--------- worker/worker.ts | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ui/overrides.tsx b/src/ui/overrides.tsx index 7384557..729516e 100644 --- a/src/ui/overrides.tsx +++ b/src/ui/overrides.tsx @@ -289,15 +289,12 @@ export const overrides: TLUiOverrides = { kbd: "alt+b", readonlyOk: true, onSelect: () => { - const otherUsers = Array.from(editor.store.allRecords()).filter( - (record) => - record.typeName === "instance_presence" && - record.id !== editor.user.getId(), - ) - - otherUsers.forEach((user) => { - editor.startFollowingUser(user.id) - }) + const collaborators = editor.getCollaborators() + collaborators + .filter((user) => user.id !== editor.user.getId()) + .forEach((user) => { + editor.startFollowingUser(user.id) + }) }, }, stopBroadcast: { diff --git a/worker/worker.ts b/worker/worker.ts index 28728de..32606a5 100644 --- a/worker/worker.ts +++ b/worker/worker.ts @@ -40,7 +40,7 @@ const { preflight, corsify } = cors({ // For development - check if it's a localhost or local IP if ( origin.match( - /^http:\/\/(localhost|127\.0\.0\.192\.168\.|169\.254\.|10\.)/, + /^http:\/\/(localhost|127\.0\.0\.1|192\.168\.|169\.254\.|10\.)/, ) ) { return origin