fix: Skip Setup button no longer traps users when unauthenticated
The Skip button awaited saveConfigToServer() which fails with 403 when TOTP is required, preventing the wizard from dismissing. Fix: hide wizard FIRST (localStorage-only), then fire server save as fire-and-forget with .catch().
This commit is contained in:
@@ -252,10 +252,11 @@ window.populateTimezoneSelect = function(selectEl, selectedTz) {
|
||||
skipBtn.onclick = async function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm('Skip setup? You can run it later from Settings.')) {
|
||||
// Save skip status to server
|
||||
await saveConfigToServer({ setupComplete: true, skipped: true, timestamp: new Date().toISOString() });
|
||||
// Save skip status — hide wizard FIRST so it always dismisses,
|
||||
// then attempt server save (fire-and-forget, never blocks UI)
|
||||
safeSet('dashcaddy-setup', 'skipped');
|
||||
document.getElementById('setup-wizard').style.display = 'none';
|
||||
saveConfigToServer({ setupComplete: true, skipped: true, timestamp: new Date().toISOString() }).catch(() => {});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user