one more attempt
This commit is contained in:
parent
111be03907
commit
110fc19b94
|
|
@ -1,4 +1,5 @@
|
||||||
import { useSync } from '@tldraw/sync'
|
import { useSync } from '@tldraw/sync'
|
||||||
|
import { useMemo } from 'react'
|
||||||
import {
|
import {
|
||||||
AssetRecordType,
|
AssetRecordType,
|
||||||
getHashForString,
|
getHashForString,
|
||||||
|
|
@ -10,7 +11,6 @@ import {
|
||||||
TLUiEventSource,
|
TLUiEventSource,
|
||||||
} from 'tldraw'
|
} from 'tldraw'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import useLocalStorageState from 'use-local-storage-state'
|
|
||||||
import { ChatBoxTool } from '@/tools/ChatBoxTool'
|
import { ChatBoxTool } from '@/tools/ChatBoxTool'
|
||||||
import { ChatBoxShape } from '@/shapes/ChatBoxShapeUtil'
|
import { ChatBoxShape } from '@/shapes/ChatBoxShapeUtil'
|
||||||
import { VideoChatTool } from '@/tools/VideoChatTool'
|
import { VideoChatTool } from '@/tools/VideoChatTool'
|
||||||
|
|
@ -38,14 +38,14 @@ export function Board() {
|
||||||
const { slug } = useParams<{ slug: string }>();
|
const { slug } = useParams<{ slug: string }>();
|
||||||
const roomId = slug || 'default-room';
|
const roomId = slug || 'default-room';
|
||||||
|
|
||||||
const store = useSync({
|
const storeConfig = useMemo(() => ({
|
||||||
uri: `${WORKER_URL}/connect/${roomId}`,
|
uri: `${WORKER_URL}/connect/${roomId}`,
|
||||||
assets: multiplayerAssetStore,
|
assets: multiplayerAssetStore,
|
||||||
shapeUtils: [...shapeUtils, ...defaultShapeUtils],
|
shapeUtils: [...shapeUtils, ...defaultShapeUtils],
|
||||||
// Add default bindings if you're using them
|
|
||||||
bindingUtils: [...defaultBindingUtils],
|
bindingUtils: [...defaultBindingUtils],
|
||||||
})
|
}), [roomId]);
|
||||||
|
|
||||||
|
const store = useSync(storeConfig);
|
||||||
const [editor, setEditor] = useState<Editor | null>(null)
|
const [editor, setEditor] = useState<Editor | null>(null)
|
||||||
const { zoomToFrame, copyFrameLink, copyLocationLink, revertCamera } = useCameraControls(editor)
|
const { zoomToFrame, copyFrameLink, copyLocationLink, revertCamera } = useCameraControls(editor)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue