We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92a8d3a commit 1576217Copy full SHA for 1576217
app/hooks/useAssistantSettings.tsx
@@ -133,8 +133,20 @@ export const AssistantSettingsProvider = ({
133
}, []);
134
135
const refreshFromStorage = useCallback(() => {
136
- const latestSettings = readStoredSettings();
137
- setSettings(latestSettings);
+ setSettings((prev) => {
+ const storedSettings = readStoredSettings();
138
+
139
+ if (storedSettings.saveToLocalStorage) {
140
+ return storedSettings;
141
+ }
142
143
+ return {
144
+ ...prev,
145
+ ...storedSettings,
146
+ openaiApiKey: prev.openaiApiKey,
147
+ geminiApiKey: prev.geminiApiKey,
148
+ };
149
+ });
150
151
152
const value = useMemo(
0 commit comments