Files
nofx/web/src
0xYYBB | ZYY | Bobo 79358d4776 fix(web): await mutateTraders() to eliminate 3-4s delay after operations (#989)
## Problem
When creating/editing/deleting traders, AI models, or exchanges, the UI
takes 3-4 seconds to show results, causing users to think the system is frozen.

## Root Cause
Although mutateTraders() was called after operations, it was not awaited,
causing the function to continue immediately without waiting for data refresh.
The UI relied on the refreshInterval: 5000 automatic refresh, resulting in
up to 5 seconds of delay.

## Solution
Added await before all mutateTraders() calls to ensure data is refreshed
before closing modals or showing success messages.

Changes:
- handleCreateTrader: Added await before mutateTraders()
- handleSaveEditTrader: Added await before mutateTraders()
- handleDeleteTrader: Added await before mutateTraders()
- handleToggleTrader: Added await before mutateTraders()

Impact:
- From 3-4s delay to immediate display (< 500ms)
- Significantly improved UX
- Consistent with AI model and exchange config behavior

Testing:
- Frontend build successful
- No TypeScript errors
- Ready for manual UI testing

Co-authored-by: the-dev-z <the-dev-z@users.noreply.github.com>
2025-11-15 22:20:06 -05:00
..
2025-11-05 22:39:42 +08:00