fix(frontend): guard copilotMode storage.get behind isClient

Missed this initializer when porting the SSR guards — copilotMode was
calling storage.get() unconditionally while its neighbours
(completedSessionIDs, isSoundEnabled, isNotificationsEnabled) already
check isClient first. Flagged by Sentry (MEDIUM): storage.get() is
designed to throw on the server, so every SSR pass was generating
noise in error tracking.
This commit is contained in:
Zamil Majdy
2026-04-05 13:19:13 +02:00
parent 7d061a0de0
commit cdb2699477

View File

@@ -109,7 +109,9 @@ export const useCopilotUIStore = create<CopilotUIState>((set) => ({
setShowNotificationDialog: (show) => set({ showNotificationDialog: show }),
copilotMode:
storage.get(Key.COPILOT_MODE) === "fast" ? "fast" : "extended_thinking",
isClient && storage.get(Key.COPILOT_MODE) === "fast"
? "fast"
: "extended_thinking",
setCopilotMode: (mode) => {
storage.set(Key.COPILOT_MODE, mode);
set({ copilotMode: mode });