diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx index b93921a29eb..06a09ca2c37 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatUI.tsx @@ -348,8 +348,12 @@ const ChatUI: React.FC = ({ ]); useEffect(() => { - setSecureItem("apiKeySource", JSON.stringify(apiKeySource)); - setSecureItem("apiKey", apiKey); + try { + setSecureItem("apiKeySource", JSON.stringify(apiKeySource)); + setSecureItem("apiKey", apiKey); + } catch { + // Storage full or unavailable — non-critical, skip persisting. + } sessionStorage.setItem("endpointType", endpointType); sessionStorage.setItem("selectedTags", JSON.stringify(selectedTags)); sessionStorage.setItem("selectedVectorStores", JSON.stringify(selectedVectorStores)); diff --git a/ui/litellm-dashboard/src/utils/secureStorage.ts b/ui/litellm-dashboard/src/utils/secureStorage.ts index 6942368bcf2..183b572e737 100644 --- a/ui/litellm-dashboard/src/utils/secureStorage.ts +++ b/ui/litellm-dashboard/src/utils/secureStorage.ts @@ -18,11 +18,7 @@ function decode(encoded: string): string { } export function setSecureItem(key: string, value: string): void { - try { - window.sessionStorage.setItem(key, encode(value)); - } catch { - // Storage full or unavailable — silently ignore. - } + window.sessionStorage.setItem(key, encode(value)); } export function getSecureItem(key: string): string | null {