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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user