Fix to not ignore the userId
option for <Tldraw/>
component in @tldraw/tldraw
(#1205)
The `userId` prop in the `<Tldraw/>` component from the `@tldraw/tldraw` was previously ignored. This PR fixes that to make it operational again.
This commit is contained in:
parent
121ec72f25
commit
da613ea6ef
1 changed files with 4 additions and 2 deletions
|
@ -21,15 +21,17 @@ export function Tldraw(
|
||||||
|
|
||||||
const userData = getUserData()
|
const userData = getUserData()
|
||||||
|
|
||||||
|
const userId = props.userId ?? userData.id
|
||||||
|
|
||||||
const syncedStore = useLocalSyncClient({
|
const syncedStore = useLocalSyncClient({
|
||||||
instanceId,
|
instanceId,
|
||||||
userId: userData.id,
|
userId: userId,
|
||||||
universalPersistenceKey: persistenceKey,
|
universalPersistenceKey: persistenceKey,
|
||||||
config: props.config,
|
config: props.config,
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TldrawEditor {...rest} instanceId={instanceId} userId={userData.id} store={syncedStore}>
|
<TldrawEditor {...rest} instanceId={instanceId} userId={userId} store={syncedStore}>
|
||||||
<TldrawUi {...rest}>
|
<TldrawUi {...rest}>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<Canvas />
|
<Canvas />
|
||||||
|
|
Loading…
Reference in a new issue