fix: broadcast state change after redraw current round

Add emit('stateChange') to notify frontend clients when
lottery round is redrawn, so UI updates correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-29 02:05:39 +08:00
parent 5ef68b1264
commit 57cbaa5728

View File

@@ -521,6 +521,9 @@ class AdminService extends EventEmitter {
this.state.lottery.currentWinners = [];
await this.saveState();
// Broadcast state change to all clients
this.emit('stateChange', this.getState());
logger.warn({ round: currentRound, clearedWinners: winnersToRemove.length }, 'Current round redrawn');
return { success: true, message: `${currentRound}轮已重置,可重新抽取` };