fix: auto-refresh page when closing Settings with X
FlowDeck CI / test (push) Failing after 5s
FlowDeck CI / docker (push) Has been skipped

closeSettings() now:
- Refreshes the parent page (history.back + reload)
- Handles tab navigation between settings sections
- Falls back to /workspaces redirect if no history
This commit is contained in:
2026-07-15 08:10:01 -04:00
parent 17666b51c2
commit 3fdcc41d10
+17 -3
View File
@@ -799,12 +799,26 @@ document.addEventListener('alpine:init', function() {
} catch(e) {}
},
closeSettings() {
// Go back to previous page, skipping any hash-only navigation
if (document.referrer && document.referrer.includes('/settings')) {
// Came from another settings tab — use history until we leave settings
// Refresh parent page after settings changes, then navigate back
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
window.close();
return;
}
// If navigated directly to settings, redirect to workspaces (forces refresh)
if (!document.referrer || document.referrer === window.location.href) {
window.location.href = '/workspaces?ts=' + Date.now();
return;
}
// Go back and force refresh
var prev = document.referrer;
if (prev && prev.includes('/settings')) {
// Came from another settings tab — go back two steps then refresh
history.go(-2);
setTimeout(function() { window.location.reload(); }, 100);
} else {
history.back();
setTimeout(function() { window.location.reload(); }, 100);
}
},
};