mirror of
https://github.com/open-webui/open-webui
synced 2025-05-30 02:02:13 +00:00
refac
This commit is contained in:
parent
f3a4d61f81
commit
c0b93791dc
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { settings } from '$lib/stores';
|
import { settings, playingNotificationSound } from '$lib/stores';
|
||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
|
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
@ -17,8 +17,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($settings?.notificationSound ?? true) {
|
if ($settings?.notificationSound ?? true) {
|
||||||
const audio = new Audio(`/audio/notification.mp3`);
|
if (!$playingNotificationSound) {
|
||||||
audio.play();
|
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>
|
</script>
|
||||||
|
@ -69,6 +69,9 @@ export const temporaryChatEnabled = writable(false);
|
|||||||
export const scrollPaginationEnabled = writable(false);
|
export const scrollPaginationEnabled = writable(false);
|
||||||
export const currentChatPage = writable(1);
|
export const currentChatPage = writable(1);
|
||||||
|
|
||||||
|
|
||||||
|
export const playingNotificationSound = writable(false);
|
||||||
|
|
||||||
export type Model = OpenAIModel | OllamaModel;
|
export type Model = OpenAIModel | OllamaModel;
|
||||||
|
|
||||||
type BaseModel = {
|
type BaseModel = {
|
||||||
|
Loading…
Reference in New Issue
Block a user