audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: sync accent color from server to localStorage on fetch (#1136)

Accent color was never synced from the server response to localStorage
or applied to the DOM in preferences.fetch(). Theme was synced but
accent wasn't, so on fresh loads or account switches --accent stayed
at the CSS default blue regardless of the user's saved preference.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

authored by

nate nowack
Claude Opus 4.6
and committed by
GitHub
28a65d30 88a359fe

+15
+15
frontend/src/lib/preferences.svelte.ts
··· 143 143 this.update({ theme }); 144 144 } 145 145 146 + applyAccentColor(color: string): void { 147 + if (!browser) return; 148 + const root = document.documentElement; 149 + root.style.setProperty('--accent', color); 150 + const r = parseInt(color.slice(1, 3), 16); 151 + const g = parseInt(color.slice(3, 5), 16); 152 + const b = parseInt(color.slice(5, 7), 16); 153 + const hover = `rgb(${Math.min(255, r + 30)}, ${Math.min(255, g + 30)}, ${Math.min(255, b + 30)})`; 154 + root.style.setProperty('--accent-hover', hover); 155 + } 156 + 146 157 applyTheme(theme: Theme): void { 147 158 if (!browser) return; 148 159 const root = document.documentElement; ··· 210 221 // sync localStorage cache and apply 211 222 if (browser) { 212 223 localStorage.setItem('theme', this.data.theme); 224 + if (this.data.accent_color) { 225 + localStorage.setItem('accentColor', this.data.accent_color); 226 + this.applyAccentColor(this.data.accent_color); 227 + } 213 228 this.applyTheme(this.data.theme); 214 229 if (this.data.theme === 'live') { 215 230 ambient.activate();