diff --git a/web/js/pqueue.events.js b/web/js/pqueue.events.js index e867619..f5e7567 100644 --- a/web/js/pqueue.events.js +++ b/web/js/pqueue.events.js @@ -313,6 +313,7 @@ const dir = (state.historyPaging?.params?.sort_dir === 'asc') ? 'asc' : 'desc'; if (grid && sentinel && list.length) { UI.withStableAnchor(() => { + try { Array.from(grid.querySelectorAll('.pqueue-empty')).forEach((n) => n.remove()); } catch (err) { /* noop */ } for (const row of list) { const id = row?.id; if (id == null || state.historyIds.has(id)) continue; diff --git a/web/js/pqueue.ui.js b/web/js/pqueue.ui.js index de009f0..d983bde 100644 --- a/web/js/pqueue.ui.js +++ b/web/js/pqueue.ui.js @@ -639,6 +639,7 @@ if (!grid || !sentinel) return; const dir = (state.historyPaging?.params?.sort_dir === 'asc') ? 'asc' : 'desc'; UI.withStableAnchor(() => { + try { Array.from(grid.querySelectorAll('.pqueue-empty')).forEach((n) => n.remove()); } catch (err) { /* noop */ } const existingIds = new Set(Array.from(grid.querySelectorAll('.pqueue-history-card')).map((n) => n.getAttribute('data-id'))); const ordered = Array.isArray(state.history) ? state.history.slice() : []; try { @@ -800,6 +801,7 @@ } catch (err) { /* noop */ } if (!state.historyIds) state.historyIds = new Set(); UI.withStableAnchor(() => { + try { Array.from(grid.querySelectorAll('.pqueue-empty')).forEach((n) => n.remove()); } catch (err) { /* noop */ } for (const row of list) { const id = row?.id; if (id == null || state.historyIds.has(id)) continue;