mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 22:05:19 +00:00
refac
This commit is contained in:
parent
f3a4d61f81
commit
c0b93791dc
2 changed files with 13 additions and 3 deletions
|
|
@ -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) {
|
||||||
|
if (!$playingNotificationSound) {
|
||||||
|
playingNotificationSound.set(true);
|
||||||
|
|
||||||
const audio = new Audio(`/audio/notification.mp3`);
|
const audio = new Audio(`/audio/notification.mp3`);
|
||||||
audio.play();
|
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 a new issue