diff --git a/src/components/Board.tsx b/src/components/Board.tsx index 463d3c3..27deec8 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -26,14 +26,10 @@ import { components, uiOverrides } from '@/ui-overrides' import { useCameraControls } from '@/hooks/useCameraControls' //const WORKER_URL = `https://jeffemmett-canvas.jeffemmett.workers.dev` -export const WORKER_URL = (() => { - // During development - if (import.meta.env.DEV) { - return 'http://127.0.0.1:5172'; - } - // In production - return import.meta.env.VITE_TLDRAW_WORKER_URL || 'https://jeffemmett-canvas.jeffemmett.workers.dev'; -})(); +const DEFAULT_WORKER_URL = 'https://jeffemmett-canvas.jeffemmett.workers.dev'; +export const WORKER_URL = typeof import.meta.env.VITE_TLDRAW_WORKER_URL === 'string' + ? import.meta.env.VITE_TLDRAW_WORKER_URL + : DEFAULT_WORKER_URL; const shapeUtils = [ChatBoxShape, VideoChatShape, EmbedShape] const tools = [ChatBoxTool, VideoChatTool, EmbedTool]; // Array of tools