reorganize js callbacks and startup sequence

This commit is contained in:
Vladimir Mandic
2024-04-04 18:26:51 -04:00
parent 77db12765d
commit 9d04255b54
22 changed files with 98 additions and 80 deletions
+1 -3
View File
@@ -3,7 +3,7 @@
let lastHeadImg = null;
let notificationButton = null;
function initNotifications() {
async function initNotifications() {
if (!notificationButton) {
notificationButton = gradioApp().getElementById('request_notifications');
if (notificationButton) notificationButton.addEventListener('click', (evt) => Notification.requestPermission(), true);
@@ -28,5 +28,3 @@ function initNotifications() {
};
log('sendNotification');
}
onAfterUiUpdate(initNotifications);