refactor(chat): make external browser launch user initiated
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user