From 1c1bf38431eeb10e4c67386aaa45e88055bc0fb5 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 02:01:43 -0500 Subject: [PATCH] fix(dashboard): account history reloads without a script error The account page throttled its account_notes watcher around the check of which account changed, but a throttled call gets no event, so every change threw "Cannot read properties of undefined (reading 'id')" and the history never reloaded. The check now runs first and only the reload is throttled. Check: lock or unlock an account (or add a note from another tab): the history list on its page updates, and the browser console shows no error. Co-Authored-By: Claude Opus 5.5 --- dDashboardServer/templates/account-view.jinja2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dDashboardServer/templates/account-view.jinja2 b/dDashboardServer/templates/account-view.jinja2 index 0eaafa304..03e71c105 100644 --- a/dDashboardServer/templates/account-view.jinja2 +++ b/dDashboardServer/templates/account-view.jinja2 @@ -592,7 +592,11 @@ if (document.getElementById('noteForm')) { if (del && confirm('Delete this entry from the history?')) api.action('/api/account_notes/' + del.dataset.deleteNote + '/delete', {}).then(loadNotes).catch(function () {}); }); loadNotes(); - if (window.Live) Live.on('account_notes', Live.throttle(function (e) { if (!e.id || e.id === String(accountId)) loadNotes(); }, 1000)); + // Only changes to this account's history; throttled after that check, since a throttled call gets no event + if (window.Live) { + var reloadNotes = Live.throttle(loadNotes, 1000); + Live.on('account_notes', function (e) { if (!e.id || String(e.id) === String(accountId)) reloadNotes(); }); + } } function toggleLock(locked) { if (!confirm((locked ? 'Lock' : 'Unlock') + ' this account?')) return;