refactor(chat): make external browser launch user initiated

This commit is contained in:
2026-07-09 15:18:52 +08:00
parent 360db0f813
commit dfa5b0c068
7 changed files with 56 additions and 136 deletions
+1 -20
View File
@@ -1,28 +1,9 @@
"use client";
import { AppStorage } from "@/data/storage/app/app_storage";
import { AuthStorage } from "@/data/storage/auth/auth_storage";
import { UserStorage } from "@/data/storage/user/user_storage";
import { ROUTES } from "@/router/routes";
import { todayString, UrlLauncherUtil } from "@/utils";
export async function resolveExternalBrowserPromptEligibility(): Promise<{
canShow: boolean;
today: string;
}> {
const today = todayString();
const result = await AppStorage.canShowExternalBrowserDialog(today);
return {
canShow: result.success && result.data,
today,
};
}
export function recordExternalBrowserPromptShown(
today: string,
): Promise<unknown> {
return AppStorage.recordExternalBrowserDialogShown(today);
}
import { UrlLauncherUtil } from "@/utils";
export async function openChatInExternalBrowser(): Promise<void> {
const authStorage = AuthStorage.getInstance();