feat(chat): trigger pwa prompt after message threshold
This commit is contained in:
@@ -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 安装提示触发器(无可见 UI,3.5s 后弹 dialog) */}
|
||||
<PwaInstallOverlay />
|
||||
{/* PWA 安装提示触发器(聊天消息数量达到阈值后才允许弹出) */}
|
||||
<PwaInstallOverlay enabled={shouldShowPwaInstall} />
|
||||
|
||||
<ExternalBrowserDialog
|
||||
open={showExternalBrowserDialog}
|
||||
|
||||
Reference in New Issue
Block a user