adds support for a notification.mp3 in the root directory that will play upon completion (fixes #1013)

This commit is contained in:
Connum
2022-09-26 22:57:31 +02:00
parent 78d6aef302
commit 2846ca5702
3 changed files with 11 additions and 4 deletions

View File

@@ -25,6 +25,9 @@ onUiUpdate(function(){
lastHeadImg = headImg;
// play notification sound if available
gradioApp().querySelector('#audio_notification audio')?.play();
if (document.hasFocus()) return;
// Multiple copies of the images are in the DOM when one is selected. Dedup with a Set to get the real number generated.