aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorConnum <connum@gmail.com>2022-09-26 22:57:31 +0200
committerConnum <connum@gmail.com>2022-09-26 22:57:31 +0200
commit2846ca57028cca1a9ce9cee66d2500b4ac38a9c6 (patch)
tree5955b13f1edcc8ac57a6d59a99a4d9181438b1b7 /javascript
parent78d6aef30249530d8cc0b5023b2f8bf8c86f8446 (diff)
adds support for a notification.mp3 in the root directory that will play upon completion (fixes #1013)
Diffstat (limited to 'javascript')
-rw-r--r--javascript/notification.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/javascript/notification.js b/javascript/notification.js
index e8159a7e..bdf614ad 100644
--- a/javascript/notification.js
+++ b/javascript/notification.js
@@ -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.