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'; }