mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user