接入桌面壳窗口标题同步路径
H5 主站按当前平台阶段同步 document.title native_app 中通过 app.setTitle 请求 Tauri 窗口标题同步 补充标题同步测试和宿主壳能力文档
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -23,6 +23,10 @@ import {
|
||||
resolveSelectionStageFromPath,
|
||||
} from './routing/appPageRoutes';
|
||||
import type { RpgRuntimeAppIntent } from './RpgRuntimeApp';
|
||||
import {
|
||||
resolveAppTitleForSelectionStage,
|
||||
syncAppTitle,
|
||||
} from './services/appTitle';
|
||||
import type { CustomWorldProfile } from './types';
|
||||
|
||||
const RpgRuntimeApp = lazy(async () => {
|
||||
@@ -134,6 +138,14 @@ export default function App() {
|
||||
? 'platform-theme--dark'
|
||||
: 'platform-theme--light';
|
||||
|
||||
useEffect(() => {
|
||||
syncAppTitle(
|
||||
isRuntimeActive
|
||||
? 'RPG 运行中 - 陶泥儿'
|
||||
: resolveAppTitleForSelectionStage(selectionStage),
|
||||
);
|
||||
}, [isRuntimeActive, selectionStage]);
|
||||
|
||||
if (isRuntimeActive) {
|
||||
return (
|
||||
<Suspense fallback={<RuntimeLoadingFallback />}>
|
||||
|
||||
Reference in New Issue
Block a user