logs
This commit is contained in:
@@ -69,20 +69,24 @@ export function getIO() {
|
||||
export const socketEvents = {
|
||||
// Emit to specific user
|
||||
emitToUser(userId, event, data) {
|
||||
console.log(`🔔 Emitting ${event} to user:${userId}`);
|
||||
io.to(`user:${userId}`).emit(event, data);
|
||||
},
|
||||
|
||||
// Emit to all users in a challenge
|
||||
emitToChallenge(challengeId, event, data) {
|
||||
console.log(`🔔 Emitting ${event} to challenge:${challengeId}`);
|
||||
io.to(`challenge:${challengeId}`).emit(event, data);
|
||||
},
|
||||
|
||||
// Prediction events
|
||||
predictionCreated(challengeId, prediction) {
|
||||
console.log(`📤 Emitting prediction:created for challenge ${challengeId}`, prediction);
|
||||
this.emitToChallenge(challengeId, 'prediction:created', prediction);
|
||||
},
|
||||
|
||||
predictionValidated(challengeId, prediction) {
|
||||
console.log(`📤 Emitting prediction:validated for challenge ${challengeId}`, prediction);
|
||||
this.emitToChallenge(challengeId, 'prediction:validated', prediction);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user