Files
Genarrative/src/active-main.tsx
T
kdletters efbdf7031e
Project CI / AI game creator shell Rust crates (push) Successful in 1m30s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m57s
Project CI / Backend tests (push) Successful in 3m54s
Project CI / Frontend tests (push) Successful in 2m5s
Project CI / Native shell tests (push) Successful in 6m4s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 8m14s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 9m19s
Project CI / AI game creator shell web tests (push) Successful in 1m23s
Project CI / Repository checks (push) Successful in 1m55s
统一客户端维护态错误弹窗
客户端维护响应统一识别并广播维护事件

AGC 与网页端根部展示维护大弹窗,收口发布、上传、资源换签和登录错误

补充维护态弹窗测试、类型检查与实施计划说明
2026-09-23 23:16:23 +08:00

56 lines
1.6 KiB
TypeScript

/* eslint-disable react-refresh/only-export-components */
import '@genarrative/image-canvas-react/styles.css';
import './index.css';
import { StrictMode, Suspense } from 'react';
import { createRoot } from 'react-dom/client';
import { FloatingFeedbackEntry } from './components/common/FloatingFeedbackEntry';
import { MaintenanceNotice } from './components/common/MaintenanceNotice';
import { stabilizeMobileViewportKeyboardFocus } from './mobileViewportKeyboardFocus';
import { lockMobileViewportZoom } from './mobileViewportZoomLock';
import { resolveAppRoute } from './routing/activeAppRoutes';
import {
getHostRuntime,
refreshNativeAppHostRuntime,
} from './services/host-bridge/hostBridge';
type AppRoot = ReturnType<typeof createRoot>;
declare global {
interface Window {
__tavernRealmsRoot__?: AppRoot;
}
}
const route = resolveAppRoute(window.location.pathname);
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error('Missing #root container');
}
function markWechatMiniProgramRuntime() {
if (getHostRuntime().kind === 'wechat_mini_program') {
document.documentElement.dataset.wechatMiniProgramRuntime = 'true';
}
}
const root = (window.__tavernRealmsRoot__ ??= createRoot(rootElement));
const RouteComponent = route.Component;
const routeElement = <RouteComponent />;
lockMobileViewportZoom();
stabilizeMobileViewportKeyboardFocus();
markWechatMiniProgramRuntime();
void refreshNativeAppHostRuntime();
root.render(
<StrictMode>
<Suspense fallback={null}>{routeElement}</Suspense>
<MaintenanceNotice />
{route.kind === 'platform' ? <FloatingFeedbackEntry /> : null}
</StrictMode>,
);