feat(chat): implement external browser prompt logic and update tests
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
} from "./chat-image-overlay-url";
|
||||
import {
|
||||
deriveIsGuest,
|
||||
isChatDevelopmentEnvironment,
|
||||
shouldStartExternalBrowserPrompt,
|
||||
} from "./chat-screen.helpers";
|
||||
import { useFirstRechargeOfferBanner } from "./hooks/use-first-recharge-offer-banner";
|
||||
import { useChatUnlockNavigationFlow } from "./hooks/use-chat-unlock-navigation-flow";
|
||||
@@ -90,6 +90,11 @@ export function ChatScreen() {
|
||||
loginStatus: authState.loginStatus,
|
||||
});
|
||||
const shouldShowPwaInstall = state.historyLoaded && state.messages.length >= 10;
|
||||
const shouldShowBrowserHint = shouldStartExternalBrowserPrompt({
|
||||
hasInitialized: authState.hasInitialized,
|
||||
isLoading: authState.isLoading,
|
||||
loginStatus: authState.loginStatus,
|
||||
});
|
||||
|
||||
useChatGuestLogin({
|
||||
dispatch: authDispatch,
|
||||
@@ -186,7 +191,7 @@ export function ChatScreen() {
|
||||
</div>
|
||||
|
||||
{/* 浏览器提示(应用内浏览器检测) */}
|
||||
<BrowserHintOverlay forceShow={isChatDevelopmentEnvironment()} />
|
||||
{shouldShowBrowserHint ? <BrowserHintOverlay forceShow /> : null}
|
||||
|
||||
{/* PWA 安装提示触发器(聊天消息数量达到阈值后才允许弹出) */}
|
||||
<PwaInstallOverlay enabled={shouldShowPwaInstall} />
|
||||
|
||||
Reference in New Issue
Block a user