touchscreen: just create a new room (#3802)

further testing on staging to make this work.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know
This commit is contained in:
Mime Čuvalo 2024-05-21 22:42:11 +01:00 committed by GitHub
parent af664d55df
commit 52eeb61dcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1 additions and 32 deletions

View file

@ -34,10 +34,6 @@ exports[`the_routes 1`] = `
"reactRouterPattern": "/s/:roomId",
"vercelRouterPattern": "^/s/[^/]*/?$",
},
{
"reactRouterPattern": "/ts",
"vercelRouterPattern": "^/ts/?$",
},
{
"reactRouterPattern": "/ts-side",
"vercelRouterPattern": "^/ts-side/?$",

View file

@ -10,7 +10,6 @@ export const ROOM_CONTEXT = {
HISTORY_SNAPSHOT: 'history-snapshot',
HISTORY: 'history',
LOCAL: 'local',
PUBLIC_TOUCHSCREEN_APP: 'public-touchscreen-app',
} as const
type $ROOM_CONTEXT = (typeof ROOM_CONTEXT)[keyof typeof ROOM_CONTEXT]
@ -25,7 +24,6 @@ const WHITELIST_CONTEXT: $ROOM_CONTEXT[] = [
ROOM_CONTEXT.PUBLIC_MULTIPLAYER,
ROOM_CONTEXT.PUBLIC_READONLY,
ROOM_CONTEXT.PUBLIC_SNAPSHOT,
ROOM_CONTEXT.PUBLIC_TOUCHSCREEN_APP,
]
function getEmbeddedState(context: $ROOM_CONTEXT) {

View file

@ -1,24 +0,0 @@
import { useEffect } from 'react'
import '../../styles/globals.css'
import { IFrameProtector, ROOM_CONTEXT } from '../components/IFrameProtector'
import { LocalEditor } from '../components/LocalEditor'
export function Component() {
useEffect(() => {
async function loadSession() {
const session = await (window as any).meet.addon.createAddonSession({
cloudProjectNumber: `${process.env.GOOGLE_CLOUD_PROJECT_NUMBER}`,
})
const mainStageClient = await session.createMainStageClient()
await mainStageClient.unloadSidePanel()
}
loadSession()
}, [])
return (
<IFrameProtector slug="ts" context={ROOM_CONTEXT.PUBLIC_TOUCHSCREEN_APP}>
<LocalEditor />
</IFrameProtector>
)
}

View file

@ -16,7 +16,7 @@ export function Component() {
const sidePanelClient = await session.createSidePanelClient()
await sidePanelClient.setCollaborationStartingState({
sidePanelUrl: `${window.location.origin}/ts-side`,
mainStageUrl: `${window.location.origin}/ts`,
mainStageUrl: `${window.location.origin}/new`,
additionalData: undefined,
})
}

View file

@ -37,7 +37,6 @@ export const router = createRoutesFromElements(
<Route path="/" lazy={() => import('./pages/root')} />
<Route path={`/${ROOM_PREFIX}`} lazy={() => import('./pages/new')} />
<Route path="/new" lazy={() => import('./pages/new')} />
<Route path={`/ts`} lazy={() => import('./pages/public-touchscreen-app')} />
<Route path={`/ts-side`} lazy={() => import('./pages/public-touchscreen-side-panel')} />
<Route path={`/${ROOM_PREFIX}/:roomId`} lazy={() => import('./pages/public-multiplayer')} />
<Route path={`/${ROOM_PREFIX}/:boardId/history`} lazy={() => import('./pages/history')} />