Fix BanUnbanForm floating promises and add submit guards

This commit is contained in:
2026-04-19 19:42:39 +02:00
parent 76c9f388a8
commit 082dcc7ee1
3 changed files with 132 additions and 37 deletions

View File

@@ -53,7 +53,11 @@ Issues are grouped by category and ordered roughly by severity. Each entry descr
---
### TASK-003 — `BanUnbanForm` floating promises and no double-submit guard
### TASK-003 — `BanUnbanForm` floating promises and no double-submit guard (done)
**Where fixed:** `frontend/src/pages/jails/BanUnbanForm.tsx`, `frontend/src/pages/jails/__tests__/BanUnbanForm.test.tsx`
**Summary:** Converted ban and unban handlers to async functions with separate submit states and disabled submit buttons while requests are in flight.
**Where found:** `frontend/src/pages/jails/BanUnbanForm.tsx``handleBan` and `handleUnban` are synchronous functions that call `onBan(…).then(…).catch(…)`. The returned promise is not awaited and is not assigned to anything.