ui init error handler

Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-04-19 12:01:16 +02:00
parent 7b96a2ca69
commit 271a3421d6
3 changed files with 7 additions and 11 deletions
+3 -2
View File
@@ -1270,11 +1270,12 @@ async function initGalleryAutoRefresh() {
let galleryTab = isModern ? document.getElementById('gallery_tabitem') : document.getElementById('tab_gallery');
let timeout = 0;
while (!galleryTab && timeout++ < 60) {
await new Promise((resolve) => { setTimeout(resolve, 1000); });
await new Promise((resolve) => { setTimeout(resolve, 2500); });
galleryTab = isModern ? document.getElementById('gallery_tabitem') : document.getElementById('tab_gallery');
}
if (!galleryTab) {
throw new Error('Timed out waiting for gallery tab element');
error('Gallery: timeout');
return;
}
const displayNoneRegEx = /display:\s*none/;
async function galleryAutoRefresh(mutations) {