From e53d805bef91374412e970119d848d8e0f3d3eed Mon Sep 17 00:00:00 2001 From: Egor Date: Mon, 19 Jan 2026 10:31:50 +0300 Subject: [PATCH] Update branding.ts --- src/api/branding.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/api/branding.ts b/src/api/branding.ts index b61f2e5..0067175 100644 --- a/src/api/branding.ts +++ b/src/api/branding.ts @@ -11,6 +11,30 @@ export interface AnimationEnabled { enabled: boolean } +const BRANDING_CACHE_KEY = 'cabinet_branding' + +// Get cached branding from localStorage +export const getCachedBranding = (): BrandingInfo | null => { + try { + const cached = localStorage.getItem(BRANDING_CACHE_KEY) + if (cached) { + return JSON.parse(cached) + } + } catch { + // localStorage not available or invalid JSON + } + return null +} + +// Update branding cache in localStorage +export const setCachedBranding = (branding: BrandingInfo) => { + try { + localStorage.setItem(BRANDING_CACHE_KEY, JSON.stringify(branding)) + } catch { + // localStorage not available + } +} + export const brandingApi = { // Get current branding (public, no auth required) getBranding: async (): Promise => {