房间号格式不正确
+房间号必须是 1000..9999 的四位数字
+diff --git a/src/client/App.tsx b/src/client/App.tsx
index cfb9252..755855a 100644
--- a/src/client/App.tsx
+++ b/src/client/App.tsx
@@ -6,14 +6,13 @@ import {
getSiteAccess,
type SiteAccessStatus,
} from "./lib/api";
-import { readViewerRoute } from "./lib/session";
+import { parseAppRoute, readViewerRoute } from "./lib/session";
import { HostPage } from "./pages/HostPage";
import { JoinPage } from "./pages/JoinPage";
import { ViewerPage } from "./pages/ViewerPage";
-const viewerRoute = readViewerRoute();
-const isJoinRoute = /^\/join\/?$/.test(window.location.pathname);
-const isHostRoute = /^\/?$/.test(window.location.pathname);
+const appRoute = parseAppRoute(window.location.pathname);
+const viewerRoute = appRoute.kind === "viewer" ? readViewerRoute() : null;
type AccessState =
| { kind: "checking" }
@@ -34,20 +33,24 @@ function readableError(error: unknown): string {
}
export function App() {
- if (viewerRoute) {
+ if (appRoute.kind === "viewer" && viewerRoute) {
return viewerRoute.viewerGrant ? (
房间号必须是 1000..9999 的四位数字
+