diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index fe17475e..fb1f49f6 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -49,8 +49,10 @@ let pullProgress = null; // Addons + let responseNotification = false; let titleAutoGenerate = true; let speechAutoSend = false; + let gravatarEmail = ''; let OPENAI_API_KEY = ''; @@ -108,6 +110,19 @@ saveSettings({ titleAutoGenerate: titleAutoGenerate }); }; + const toggleResponseNotification = async () => { + const permission = await Notification.requestPermission(); + + if (permission === 'granted') { + responseNotification = !responseNotification; + saveSettings({ responseNotification: responseNotification }); + } else { + toast.error( + 'Response notifications cannot be activated as the website permissions have been denied. Please visit your browser settings to grant the necessary access.' + ); + } + }; + const toggleAuthHeader = async () => { authEnabled = !authEnabled; }; @@ -802,44 +817,66 @@ >