kopia lustrzana https://github.com/Tldraw/Tldraw
rodzic
cb9211b965
commit
68372b9d69
|
@ -113,7 +113,7 @@ export function MultiplayerEditor({
|
||||||
const handleUiEvent = useHandleUiEvents()
|
const handleUiEvent = useHandleUiEvents()
|
||||||
|
|
||||||
const storeWithStatus = useRemoteSyncClient({
|
const storeWithStatus = useRemoteSyncClient({
|
||||||
uri: `${MULTIPLAYER_SERVER}${RoomOpenModeToPath[roomOpenMode]}/${roomSlug}`,
|
uri: `${MULTIPLAYER_SERVER}/${RoomOpenModeToPath[roomOpenMode]}/${roomSlug}`,
|
||||||
roomId: roomSlug,
|
roomId: roomSlug,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@ type ShareState = {
|
||||||
|
|
||||||
function isSharedReadonlyUrl(pathname: string) {
|
function isSharedReadonlyUrl(pathname: string) {
|
||||||
return (
|
return (
|
||||||
pathname.startsWith(`${RoomOpenModeToPath[ROOM_OPEN_MODE.READ_ONLY]}/`) ||
|
pathname.startsWith(`/${RoomOpenModeToPath[ROOM_OPEN_MODE.READ_ONLY]}/`) ||
|
||||||
pathname.startsWith(`${RoomOpenModeToPath[ROOM_OPEN_MODE.READ_ONLY_LEGACY]}/`)
|
pathname.startsWith(`/${RoomOpenModeToPath[ROOM_OPEN_MODE.READ_ONLY_LEGACY]}/`)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +79,7 @@ async function getReadonlyUrl() {
|
||||||
if (!data.slug) return
|
if (!data.slug) return
|
||||||
|
|
||||||
segments[1] =
|
segments[1] =
|
||||||
RoomOpenModeToPath[
|
RoomOpenModeToPath[data.isLegacy ? ROOM_OPEN_MODE.READ_ONLY_LEGACY : ROOM_OPEN_MODE.READ_ONLY]
|
||||||
data.isLegacy ? ROOM_OPEN_MODE.READ_ONLY_LEGACY : ROOM_OPEN_MODE.READ_ONLY
|
|
||||||
].substring(1)
|
|
||||||
segments[2] = data.slug
|
segments[2] = data.slug
|
||||||
const newPathname = segments.join('/')
|
const newPathname = segments.join('/')
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue