fix(web): open settings modal before populating it

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 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-06 21:51:56 +02:00
parent 90bc4b1531
commit 7d5530e51c
2 changed files with 12 additions and 3 deletions

View File

@@ -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) {

View File

@@ -1,2 +1,2 @@
// Increment APP_VERSION with every code change
export const APP_VERSION = 'v75';
export const APP_VERSION = 'v76';