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