From 7d5530e51cbc70447f94a60e0e790d2b43141798 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Mon, 6 Jul 2026 21:51:56 +0200 Subject: [PATCH] fix(web): open settings modal before populating it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openSettingsModal() populated every field and ran render helpers (renderGroupVisibleList, renderAllAccounts, initAppPasswords) BEFORE the final openModal() call, so an error in any of them left the modal unopened — the "settings button does nothing" report. Now the modal opens first and the populate step runs in try/catch (errors logged, not fatal). v76. Co-Authored-By: Claude Opus 4.8 --- frontend/js/calendar.js | 13 +++++++++++-- frontend/js/version.js | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js index 428e53b..ba09769 100644 --- a/frontend/js/calendar.js +++ b/frontend/js/calendar.js @@ -3097,6 +3097,17 @@ function renderGroupVisibleList(selectedId) { function openSettingsModal() { uiSettingsOpen = true; writeUrlState(); + // Open the modal FIRST so a later error while populating a field (or in one of + // the render helpers below) can never prevent settings from opening at all. + openModal('modal-settings'); + try { + populateSettings(); + } catch (e) { + console.error('populateSettings failed', e); + } +} + +function populateSettings() { const s = state.settings; document.getElementById('cfg-default-view').value = s.default_view || 'month'; document.getElementById('cfg-week-start').value = s.week_start_day || 'monday'; @@ -3184,8 +3195,6 @@ function openSettingsModal() { // Render unified calendar table renderAllAccounts(); - - openModal('modal-settings'); } function activateSettingsPanel(panel) { diff --git a/frontend/js/version.js b/frontend/js/version.js index 5919ad7..9236327 100644 --- a/frontend/js/version.js +++ b/frontend/js/version.js @@ -1,2 +1,2 @@ // Increment APP_VERSION with every code change -export const APP_VERSION = 'v75'; +export const APP_VERSION = 'v76';