feat: save user settings to db

This commit is contained in:
Timothy J. Baek
2024-05-26 22:47:42 -07:00
parent 9d4c07b76a
commit ccbafca74c
16 changed files with 235 additions and 70 deletions
@@ -2,7 +2,7 @@
import fileSaver from 'file-saver';
const { saveAs } = fileSaver;
import { chats, user, config } from '$lib/stores';
import { chats, user, settings } from '$lib/stores';
import {
archiveAllChats,
@@ -99,9 +99,7 @@
};
onMount(async () => {
let settings = JSON.parse(localStorage.getItem('settings') ?? '{}');
saveChatHistory = settings.saveChatHistory ?? true;
saveChatHistory = $settings.saveChatHistory ?? true;
});
</script>