feat(chat): trigger pwa prompt after message threshold

This commit is contained in:
2026-07-03 17:50:35 +08:00
parent 36636ad77b
commit 7e559ac098
2 changed files with 21 additions and 7 deletions
+3 -2
View File
@@ -67,6 +67,7 @@ export function ChatScreen() {
historyLoaded: state.historyLoaded,
loginStatus: authState.loginStatus,
});
const shouldShowPwaInstall = state.historyLoaded && state.messages.length >= 10;
const externalBrowserPromptShownRef = useRef(false);
@@ -181,8 +182,8 @@ export function ChatScreen() {
{/* 浏览器提示(应用内浏览器检测) */}
<BrowserHintOverlay forceShow={isChatDevelopmentEnvironment()} />
{/* PWA 安装提示触发器(无可见 UI3.5s 后弹 dialog */}
<PwaInstallOverlay />
{/* PWA 安装提示触发器(聊天消息数量达到阈值后才允许弹出 */}
<PwaInstallOverlay enabled={shouldShowPwaInstall} />
<ExternalBrowserDialog
open={showExternalBrowserDialog}