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';