Fix Auto-Sync modal 'total is not defined' regression

Refactor introduced when adding the history filter dropped the
`const total = _autoSyncScheduleState.runHistoryTotal || 0;` line at
the top of populateAutoSyncHistoryList, but line 705's load-more
footer still referenced `total`. ReferenceError bubbled to the
refresh-modal catch and the modal rendered the generic 'Could not
load schedule data' error state instead of the schedule board.
This commit is contained in:
Broque Thomas 2026-05-25 15:12:31 -07:00
parent d18f45dfec
commit f98c1a5997

View file

@ -670,6 +670,7 @@ function populateAutoSyncHistoryList(root = document) {
const list = root.querySelector('.auto-sync-history-list');
if (!list) return;
const allHistory = Array.isArray(_autoSyncScheduleState.runHistory) ? _autoSyncScheduleState.runHistory : [];
const total = _autoSyncScheduleState.runHistoryTotal || 0;
const filter = _autoSyncHistoryFilter || 'all';
const history = allHistory.filter(h => {
if (filter === 'error') return h.status === 'error' || h.status === 'skipped';