fix: auth reconnection loop, duplicate login listeners, modal double-disable

- websocket: clear tokens on refresh failure to prevent infinite 401 loop
- api: write vw:user to sessionStorage on refresh for consistency with WS
- api: remove vw:user from sessionStorage in clearAuthTokens
- login: guard listener setup with flags to prevent duplicate attachment
- modal: skip inline button disable when handler uses processing state
- users: remove unused requestUpdate import
This commit is contained in:
wall
2026-07-24 04:02:44 +00:00
parent edaf16a433
commit d4213fb93b
5 changed files with 33 additions and 7 deletions
+9 -2
View File
@@ -191,8 +191,15 @@ export function formModal(inner, title, fields, actions) {
if (a.handler) {
const origHandler = a.handler;
btn.addEventListener('click', () => {
btn.disabled = true;
btn.innerHTML = '<span class="btn-spinner"></span>';
// Only inline-disable if the handler doesn't use processing
// state. apiSubmit/formAction already call
// setModalProcessing + refreshModals which re-creates the
// button in processing state. Without the guard the old
// button is discarded before the handler even starts.
if (!a.processing) {
btn.disabled = true;
btn.innerHTML = '<span class="btn-spinner"></span>';
}
origHandler();
});
}