mirror of
https://github.com/jcreek/EstimationPoker.git
synced 2026-07-13 02:53:46 +00:00
feat(*): Handle emoji throwing on server
This commit is contained in:
+14
-1
@@ -110,7 +110,11 @@ wss.on('connection', (ws: WebSocket, req) => {
|
||||
if (allEstimates.size === room.getUsers().length) {
|
||||
const users = room.getUsers();
|
||||
const average = calculateAverageEstimate(users);
|
||||
broadcastToRoom(room.id, { type: 'estimation-closed', average, groupedEstimates: groupEstimates(users)});
|
||||
broadcastToRoom(room.id, {
|
||||
type: 'estimation-closed',
|
||||
average,
|
||||
groupedEstimates: groupEstimates(users)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,6 +128,15 @@ wss.on('connection', (ws: WebSocket, req) => {
|
||||
const users = room.getUsers();
|
||||
broadcastToRoom(room.id, { type: 'user-estimates', users });
|
||||
}
|
||||
} else if (data.type === 'trigger-emoji') {
|
||||
const { cardId, emoji } = data;
|
||||
if (room) {
|
||||
broadcastToRoom(room.id, {
|
||||
type: 'trigger-emoji',
|
||||
cardId,
|
||||
emoji
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user