From f2285f29b799c8e9d668f475651b961136a1ef56 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 26 May 2024 22:52:29 -0700 Subject: [PATCH] refac: save only to db --- src/lib/components/chat/ModelSelector.svelte | 2 -- src/lib/components/chat/SettingsModal.svelte | 2 -- src/lib/components/layout/Sidebar.svelte | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index 75a4dcc9c..ed7545eb1 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -22,8 +22,6 @@ return; } settings.set({ ...$settings, models: selectedModels }); - - localStorage.setItem('settings', JSON.stringify($settings)); await updateUserSettings(localStorage.token, { ui: $settings }); if ($user.role === 'admin') { diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 0073a15e8..6bfebfecb 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -27,8 +27,6 @@ console.log(updated); await settings.set({ ...$settings, ...updated }); await models.set(await getModels()); - - localStorage.setItem('settings', JSON.stringify($settings)); await updateUserSettings(localStorage.token, { ui: $settings }); }; diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 44a8c10a1..c746e343a 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -184,9 +184,7 @@ const saveSettings = async (updated) => { await settings.set({ ...$settings, ...updated }); - localStorage.setItem('settings', JSON.stringify($settings)); await updateUserSettings(localStorage.token, { ui: $settings }); - location.href = '/'; };