Log denemesi
This commit is contained in:
parent
b0566b7c6b
commit
0db26ba738
2 changed files with 11 additions and 6 deletions
|
|
@ -110,15 +110,15 @@ export class SignalRService {
|
|||
})
|
||||
|
||||
this.connection.onclose(async (err) => {
|
||||
// 🚨 İlk satırda kontrol et
|
||||
console.warn('🔥 onclose triggered, isKicked=', this.isKicked)
|
||||
|
||||
if (this.isKicked) {
|
||||
this.isConnected = false
|
||||
this.currentSessionId = undefined
|
||||
return
|
||||
return // ❗ Kick durumunda kesinlikle LeaveClass çağırma
|
||||
}
|
||||
|
||||
this.isConnected = false
|
||||
|
||||
try {
|
||||
if (this.currentSessionId) {
|
||||
await this.connection.invoke('LeaveClass', this.currentSessionId)
|
||||
|
|
@ -147,12 +147,17 @@ export class SignalRService {
|
|||
|
||||
this.isKicked = true
|
||||
|
||||
// 🔑 Cleanup’u dışarıya delege et
|
||||
if (this.onForceCleanup) {
|
||||
console.warn('⚡ ForceCleanup callback çağrılıyor')
|
||||
this.onForceCleanup()
|
||||
}
|
||||
|
||||
try {
|
||||
await this.connection.stop()
|
||||
} catch (e) {
|
||||
console.warn('connection.stop hata:', e)
|
||||
}
|
||||
|
||||
this.isConnected = false
|
||||
|
||||
if (this.currentSessionId && store.getState().auth.user) {
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ const RoomDetail: React.FC = () => {
|
|||
|
||||
signalRServiceRef.current.setForceCleanupHandler(() => {
|
||||
webRTCServiceRef.current?.closeAllConnections()
|
||||
localStream?.getTracks().forEach((track) => track.stop())
|
||||
localStream?.getTracks().forEach((t) => t.stop())
|
||||
})
|
||||
|
||||
signalRServiceRef.current.setParticipantLeaveHandler(({ userId, sessionId }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue