mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
refac
This commit is contained in:
parent
f3a4d61f81
commit
c0b93791dc
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { settings } from '$lib/stores';
|
||||
import { settings, playingNotificationSound } from '$lib/stores';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
import { marked } from 'marked';
|
||||
@ -17,8 +17,15 @@
|
||||
}
|
||||
|
||||
if ($settings?.notificationSound ?? true) {
|
||||
const audio = new Audio(`/audio/notification.mp3`);
|
||||
audio.play();
|
||||
if (!$playingNotificationSound) {
|
||||
playingNotificationSound.set(true);
|
||||
|
||||
const audio = new Audio(`/audio/notification.mp3`);
|
||||
audio.play().finally(() => {
|
||||
// Ensure the global state is reset after the sound finishes
|
||||
playingNotificationSound.set(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -69,6 +69,9 @@ export const temporaryChatEnabled = writable(false);
|
||||
export const scrollPaginationEnabled = writable(false);
|
||||
export const currentChatPage = writable(1);
|
||||
|
||||
|
||||
export const playingNotificationSound = writable(false);
|
||||
|
||||
export type Model = OpenAIModel | OllamaModel;
|
||||
|
||||
type BaseModel = {
|
||||
|
Loading…
Reference in New Issue
Block a user