From 2ac911b73bc8f8e76b0be626498abc93872cfbbd Mon Sep 17 00:00:00 2001 From: Cooper-X-Oak Date: Thu, 30 Apr 2026 13:02:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E6=9C=AC=E4=BC=9A=E8=AF=9D=E5=86=85?= =?UTF-8?q?=E5=BB=B6=E5=90=8E=E6=8F=90=E4=BE=9B=E5=95=86=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openless-all/app/src/components/FloatingShell.tsx | 8 ++++---- openless-all/app/src/lib/providerSetup.test.ts | 2 +- openless-all/app/src/lib/providerSetup.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openless-all/app/src/components/FloatingShell.tsx b/openless-all/app/src/components/FloatingShell.tsx index a653fb9e..5b7bc2c6 100644 --- a/openless-all/app/src/components/FloatingShell.tsx +++ b/openless-all/app/src/components/FloatingShell.tsx @@ -18,7 +18,7 @@ import { getHotkeyTriggerLabel } from '../lib/hotkey'; import { getCredentials, openExternal } from '../lib/ipc'; import { OL_DATA } from '../lib/mockData'; import { - PROVIDER_SETUP_PROMPT_SEEN_KEY, + PROVIDER_SETUP_PROMPT_DEFERRED_KEY, shouldShowProviderSetupPrompt, } from '../lib/providerSetup'; import type { SettingsSectionId } from '../pages/Settings'; @@ -70,8 +70,8 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia let cancelled = false; (async () => { const credentials = await getCredentials(); - const promptSeenValue = window.localStorage.getItem(PROVIDER_SETUP_PROMPT_SEEN_KEY); - if (!cancelled && shouldShowProviderSetupPrompt(credentials, promptSeenValue)) { + const promptDeferredValue = window.sessionStorage.getItem(PROVIDER_SETUP_PROMPT_DEFERRED_KEY); + if (!cancelled && shouldShowProviderSetupPrompt(credentials, promptDeferredValue)) { setProviderPromptOpen(true); } })(); @@ -81,7 +81,7 @@ function FloatingShellBody({ os, initialTab, initialSettings }: { os: OS; initia }, []); const rememberProviderPrompt = () => { - window.localStorage.setItem(PROVIDER_SETUP_PROMPT_SEEN_KEY, '1'); + window.sessionStorage.setItem(PROVIDER_SETUP_PROMPT_DEFERRED_KEY, '1'); setProviderPromptOpen(false); }; diff --git a/openless-all/app/src/lib/providerSetup.test.ts b/openless-all/app/src/lib/providerSetup.test.ts index d1313dd0..b07d5678 100644 --- a/openless-all/app/src/lib/providerSetup.test.ts +++ b/openless-all/app/src/lib/providerSetup.test.ts @@ -42,7 +42,7 @@ assertEqual( '1', ), false, - 'do not repeat first-run prompt after the user has seen it', + 'do not repeat first-run prompt after the user has deferred it in this session', ); assertEqual( diff --git a/openless-all/app/src/lib/providerSetup.ts b/openless-all/app/src/lib/providerSetup.ts index c09db178..c4b9db3a 100644 --- a/openless-all/app/src/lib/providerSetup.ts +++ b/openless-all/app/src/lib/providerSetup.ts @@ -1,6 +1,6 @@ import type { CredentialsStatus } from './types'; -export const PROVIDER_SETUP_PROMPT_SEEN_KEY = 'ol.providerSetupPromptSeen'; +export const PROVIDER_SETUP_PROMPT_DEFERRED_KEY = 'ol.providerSetupPromptDeferredThisSession'; export function areProvidersConfigured(credentials: CredentialsStatus): boolean { return credentials.volcengineConfigured && credentials.arkConfigured; @@ -8,7 +8,7 @@ export function areProvidersConfigured(credentials: CredentialsStatus): boolean export function shouldShowProviderSetupPrompt( credentials: CredentialsStatus, - promptSeenValue: string | null, + promptDeferredValue: string | null, ): boolean { - return !areProvidersConfigured(credentials) && promptSeenValue !== '1'; + return !areProvidersConfigured(credentials) && promptDeferredValue !== '1'; }