Fix auto-refresh ignoring 'Off' setting on page load
Lint / Python (flake8) (push) Successful in 40s
Lint / JS (eslint) (push) Successful in 7s
Security / Python Security (bandit) (push) Successful in 39s
Test / Python Tests (pytest) (push) Successful in 53s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 2s
Lint / Python (flake8) (push) Successful in 40s
Lint / JS (eslint) (push) Successful in 7s
Security / Python Security (bandit) (push) Successful in 39s
Test / Python Tests (pytest) (push) Successful in 53s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 2s
Using || 30 / || 60 as a fallback treats refreshInterval=0 (Off) as falsy and replaces it with the default, causing auto-refresh to start even when the user saved 'Off'. Replace with nullish coalescing (??) so only null/undefined triggers the default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -469,7 +469,7 @@
|
||||
{% block scripts %}
|
||||
<script>
|
||||
// Start auto-refresh using saved settings interval (default 30 s)
|
||||
const _savedInterval = (window.gandalfSettings && window.gandalfSettings.refreshInterval) || 30;
|
||||
const _savedInterval = window.gandalfSettings?.refreshInterval ?? 30;
|
||||
if (_savedInterval > 0) lt.autoRefresh.start(refreshAll, _savedInterval * 1000);
|
||||
|
||||
// When settings change, restart auto-refresh with new interval
|
||||
|
||||
@@ -571,7 +571,7 @@ async function loadLinks() {
|
||||
}
|
||||
|
||||
loadLinks();
|
||||
const _linksInterval = (window.gandalfSettings && window.gandalfSettings.refreshInterval) || 60;
|
||||
const _linksInterval = window.gandalfSettings?.refreshInterval ?? 60;
|
||||
if (_linksInterval > 0) lt.autoRefresh.start(loadLinks, Math.max(_linksInterval, 15) * 1000);
|
||||
|
||||
window.onGandalfSettingsChanged = function(s) {
|
||||
|
||||
Reference in New Issue
Block a user