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() {
|
function openSettingsModal() {
|
||||||
uiSettingsOpen = true;
|
uiSettingsOpen = true;
|
||||||
writeUrlState();
|
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;
|
const s = state.settings;
|
||||||
document.getElementById('cfg-default-view').value = s.default_view || 'month';
|
document.getElementById('cfg-default-view').value = s.default_view || 'month';
|
||||||
document.getElementById('cfg-week-start').value = s.week_start_day || 'monday';
|
document.getElementById('cfg-week-start').value = s.week_start_day || 'monday';
|
||||||
@@ -3184,8 +3195,6 @@ function openSettingsModal() {
|
|||||||
|
|
||||||
// Render unified calendar table
|
// Render unified calendar table
|
||||||
renderAllAccounts();
|
renderAllAccounts();
|
||||||
|
|
||||||
openModal('modal-settings');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function activateSettingsPanel(panel) {
|
function activateSettingsPanel(panel) {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// Increment APP_VERSION with every code change
|
// Increment APP_VERSION with every code change
|
||||||
export const APP_VERSION = 'v75';
|
export const APP_VERSION = 'v76';
|
||||||
|
|||||||
Reference in New Issue
Block a user