From 737ab0a34adc310123650a5f2da45b07a1d0c94b Mon Sep 17 00:00:00 2001 From: how2ice Date: Fri, 29 May 2026 18:20:17 +0900 Subject: [PATCH] chore: test deploy snapshot --- src/app/main/pages/ChatSharePage.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/app/main/pages/ChatSharePage.tsx b/src/app/main/pages/ChatSharePage.tsx index 42bdfb6..aa63c9f 100644 --- a/src/app/main/pages/ChatSharePage.tsx +++ b/src/app/main/pages/ChatSharePage.tsx @@ -11,6 +11,7 @@ import { EReaderAppView } from '../../../views/play/apps/e-reader/EReaderAppView import { findReadyPlayAppEntryById, getReadyPlayAppEntries, + loadPlayAppEntriesFromServer, getSupportedPlayAppEnvironments, isPlayAppSupportedInEnvironment, type PlayAppEntry, @@ -4403,6 +4404,7 @@ export function ChatSharePage() { const composerFocusScrollTimerIdsRef = useRef([]); const [isComposerViewportCompacted, setIsComposerViewportCompacted] = useState(false); const [appLaunchUsage, setAppLaunchUsage] = useState(() => readShareAppLaunchUsage()); + const [playAppEntriesRevision, setPlayAppEntriesRevision] = useState(0); minimizedProgramsRef.current = minimizedPrograms; hasSnapshotRef.current = snapshot != null; @@ -4411,6 +4413,20 @@ export function ChatSharePage() { const isRoomSwitchingRef = useRef(isRoomSwitching); isRoomSwitchingRef.current = isRoomSwitching; + useEffect(() => { + let active = true; + + void loadPlayAppEntriesFromServer().then(() => { + if (active) { + setPlayAppEntriesRevision((current) => current + 1); + } + }); + + return () => { + active = false; + }; + }, []); + useLayoutEffect(() => { const pendingStage = pendingSnapshotPerfStageRef.current; @@ -4427,6 +4443,7 @@ export function ChatSharePage() { }, [snapshot]); const shareTokenSetting = snapshot?.share.tokenSetting ?? null; + const shareReadyPlayAppEntries = useMemo(() => getReadyPlayAppEntries(), [playAppEntriesRevision]); const shareAllowedAppIdSet = useMemo( () => buildShareAllowedAppIdSet(shareTokenSetting?.allowedAppIds, snapshot?.share.permissions), [shareTokenSetting?.allowedAppIds, snapshot?.share.permissions], @@ -4531,8 +4548,8 @@ export function ChatSharePage() { [shareRuntimeQueuedItems, shareRuntimeRecentItems, shareRuntimeRunningItems], ); const allowedPlayAppEntries = useMemo( - () => getReadyPlayAppEntries().filter((entry) => shareAllowedAppIdSet.has(entry.id)), - [shareAllowedAppIdSet], + () => shareReadyPlayAppEntries.filter((entry) => shareAllowedAppIdSet.has(entry.id)), + [shareAllowedAppIdSet, shareReadyPlayAppEntries], ); const sortedAllowedPlayAppEntries = useMemo( () => [...allowedPlayAppEntries].sort((left, right) => (