From 2846ca57028cca1a9ce9cee66d2500b4ac38a9c6 Mon Sep 17 00:00:00 2001 From: Connum Date: Mon, 26 Sep 2022 22:57:31 +0200 Subject: adds support for a notification.mp3 in the root directory that will play upon completion (fixes #1013) --- javascript/notification.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'javascript/notification.js') 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. -- cgit v1.2.1