enh: option to toggle notification sound
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
let showUsername = false;
|
||||
let richTextInput = true;
|
||||
let largeTextAsFile = false;
|
||||
let notificationSound = true;
|
||||
|
||||
let landingPageMode = '';
|
||||
let chatBubble = true;
|
||||
@@ -81,6 +82,11 @@
|
||||
saveSettings({ showUpdateToast: showUpdateToast });
|
||||
};
|
||||
|
||||
const toggleNotificationSound = async () => {
|
||||
notificationSound = !notificationSound;
|
||||
saveSettings({ notificationSound: notificationSound });
|
||||
};
|
||||
|
||||
const toggleShowChangelog = async () => {
|
||||
showChangelog = !showChangelog;
|
||||
saveSettings({ showChangelog: showChangelog });
|
||||
@@ -216,6 +222,8 @@
|
||||
chatDirection = $settings.chatDirection ?? 'LTR';
|
||||
userLocation = $settings.userLocation ?? false;
|
||||
|
||||
notificationSound = $settings.notificationSound ?? true;
|
||||
|
||||
hapticFeedback = $settings.hapticFeedback ?? false;
|
||||
|
||||
imageCompression = $settings.imageCompression ?? false;
|
||||
@@ -371,6 +379,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
<div class=" self-center text-xs">
|
||||
{$i18n.t('Notification Sound')}
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded transition"
|
||||
on:click={() => {
|
||||
toggleNotificationSound();
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if notificationSound === true}
|
||||
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if $user.role === 'admin'}
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
|
||||
Reference in New Issue
Block a user