diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 63234ef0f..66540f9cc 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -292,36 +292,36 @@ onMount(async () => { titleAutoGenerate = $settings?.title?.auto ?? true; - autoTags = $settings.autoTags ?? true; - autoFollowUps = $settings.autoFollowUps ?? true; + autoTags = $settings?.autoTags ?? true; + autoFollowUps = $settings?.autoFollowUps ?? true; - highContrastMode = $settings.highContrastMode ?? false; + highContrastMode = $settings?.highContrastMode ?? false; - detectArtifacts = $settings.detectArtifacts ?? true; - responseAutoCopy = $settings.responseAutoCopy ?? false; + detectArtifacts = $settings?.detectArtifacts ?? true; + responseAutoCopy = $settings?.responseAutoCopy ?? false; - showUsername = $settings.showUsername ?? false; - showUpdateToast = $settings.showUpdateToast ?? true; - showChangelog = $settings.showChangelog ?? true; + showUsername = $settings?.showUsername ?? false; + showUpdateToast = $settings?.showUpdateToast ?? true; + showChangelog = $settings?.showChangelog ?? true; - showEmojiInCall = $settings.showEmojiInCall ?? false; - voiceInterruption = $settings.voiceInterruption ?? false; + showEmojiInCall = $settings?.showEmojiInCall ?? false; + voiceInterruption = $settings?.voiceInterruption ?? false; - richTextInput = $settings.richTextInput ?? true; - promptAutocomplete = $settings.promptAutocomplete ?? false; - largeTextAsFile = $settings.largeTextAsFile ?? false; - copyFormatted = $settings.copyFormatted ?? false; + richTextInput = $settings?.richTextInput ?? true; + promptAutocomplete = $settings?.promptAutocomplete ?? false; + largeTextAsFile = $settings?.largeTextAsFile ?? false; + copyFormatted = $settings?.copyFormatted ?? false; - collapseCodeBlocks = $settings.collapseCodeBlocks ?? false; - expandDetails = $settings.expandDetails ?? false; + collapseCodeBlocks = $settings?.collapseCodeBlocks ?? false; + expandDetails = $settings?.expandDetails ?? false; - landingPageMode = $settings.landingPageMode ?? ''; - chatBubble = $settings.chatBubble ?? true; - widescreenMode = $settings.widescreenMode ?? false; - splitLargeChunks = $settings.splitLargeChunks ?? false; - scrollOnBranchChange = $settings.scrollOnBranchChange ?? true; - chatDirection = $settings.chatDirection ?? 'auto'; - userLocation = $settings.userLocation ?? false; + landingPageMode = $settings?.landingPageMode ?? ''; + chatBubble = $settings?.chatBubble ?? true; + widescreenMode = $settings?.widescreenMode ?? false; + splitLargeChunks = $settings?.splitLargeChunks ?? false; + scrollOnBranchChange = $settings?.scrollOnBranchChange ?? true; + chatDirection = $settings?.chatDirection ?? 'auto'; + userLocation = $settings?.userLocation ?? false; notificationSound = $settings?.notificationSound ?? true; notificationSoundAlways = $settings?.notificationSoundAlways ?? false; @@ -331,19 +331,19 @@ stylizedPdfExport = $settings?.stylizedPdfExport ?? true; - hapticFeedback = $settings.hapticFeedback ?? false; - ctrlEnterToSend = $settings.ctrlEnterToSend ?? false; + hapticFeedback = $settings?.hapticFeedback ?? false; + ctrlEnterToSend = $settings?.ctrlEnterToSend ?? false; - imageCompression = $settings.imageCompression ?? false; - imageCompressionSize = $settings.imageCompressionSize ?? { width: '', height: '' }; + imageCompression = $settings?.imageCompression ?? false; + imageCompressionSize = $settings?.imageCompressionSize ?? { width: '', height: '' }; defaultModelId = $settings?.models?.at(0) ?? ''; if ($config?.default_models) { defaultModelId = $config.default_models.split(',')[0]; } - backgroundImageUrl = $settings.backgroundImageUrl ?? null; - webSearch = $settings.webSearch ?? null; + backgroundImageUrl = $settings?.backgroundImageUrl ?? null; + webSearch = $settings?.webSearch ?? null; }); diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 68b8ac0cf..e370fc520 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -583,10 +583,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'general' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -615,10 +615,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'interface' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -648,10 +648,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'connections' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -680,10 +680,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'tools' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -713,10 +713,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'personalization' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -734,10 +734,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'audio' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -767,10 +767,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'chats' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -799,10 +799,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'account' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -831,10 +831,10 @@ class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition ${ selectedTab === 'about' - ? ($settings.highContrastMode ?? false) + ? ($settings?.highContrastMode ?? false) ? 'dark:bg-gray-800 bg-gray-200' : '' - : ($settings.highContrastMode ?? false) + : ($settings?.highContrastMode ?? false) ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' }`} @@ -868,7 +868,7 @@ {#if $user?.role === 'admin'}