Classroom Kick problem
This commit is contained in:
parent
0db26ba738
commit
cba9bdf228
2 changed files with 7 additions and 6 deletions
|
|
@ -422,6 +422,9 @@ public class ClassroomHub : Hub
|
|||
await Clients.Client(connectionId)
|
||||
.SendAsync("ForceDisconnect", "You have been removed from the class.");
|
||||
|
||||
// 🔑 Mesajın client’a ulaşmasını bekle
|
||||
await Task.Delay(200);
|
||||
|
||||
await Groups.RemoveFromGroupAsync(connectionId, sessionId.ToString());
|
||||
}
|
||||
|
||||
|
|
@ -567,11 +570,10 @@ public class ClassroomHub : Hub
|
|||
participant.IsActive = false;
|
||||
participant.ConnectionId = null;
|
||||
await _participantRepository.UpdateAsync(participant, autoSave: true);
|
||||
}
|
||||
|
||||
// 🔑 Frontend’e bildir
|
||||
await Clients.Group(participant.SessionId.ToString())
|
||||
.SendAsync("ParticipantLeft", new { UserId = userId.Value, SessionId = participant.SessionId });
|
||||
await Clients.Group(participant.SessionId.ToString())
|
||||
.SendAsync("ParticipantLeft", new { UserId = userId.Value, SessionId = participant.SessionId });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,8 +143,7 @@ export class SignalRService {
|
|||
})
|
||||
|
||||
this.connection.on('ForceDisconnect', async (message: string) => {
|
||||
console.warn('⚠️ ForceDisconnect received:', message)
|
||||
|
||||
console.warn('🚨 ForceDisconnect geldi:', message)
|
||||
this.isKicked = true
|
||||
|
||||
if (this.onForceCleanup) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue