diff --git a/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs b/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs index d48e0973..72053081 100644 --- a/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs +++ b/api/src/Kurs.Platform.HttpApi.Host/Classroom/ClassroomHub.cs @@ -423,7 +423,7 @@ public class ClassroomHub : Hub .SendAsync("ForceDisconnect", "You have been removed from the class."); // šŸ”‘ Mesajın client’a ulaşmasını bekle - await Task.Delay(200); + await Task.Delay(300); await Groups.RemoveFromGroupAsync(connectionId, sessionId.ToString()); } diff --git a/ui/src/services/classroom/signalr.ts b/ui/src/services/classroom/signalr.tsx similarity index 94% rename from ui/src/services/classroom/signalr.ts rename to ui/src/services/classroom/signalr.tsx index 8165f7e8..81fd3dc9 100644 --- a/ui/src/services/classroom/signalr.ts +++ b/ui/src/services/classroom/signalr.tsx @@ -1,3 +1,4 @@ +import { toast } from '@/components/ui' import { ClassroomAttendanceDto, ClassroomChatDto, @@ -7,6 +8,7 @@ import { import { ROUTES_ENUM } from '@/routes/route.constant' import { store } from '@/store/store' import * as signalR from '@microsoft/signalr' +import Notification from '@/components/ui/Notification' export class SignalRService { private connection!: signalR.HubConnection @@ -101,6 +103,9 @@ export class SignalRService { this.connection.onreconnected(async () => { this.isConnected = true console.warn('šŸ”„ SignalR reconnected') + toast.push(, { + placement: 'top-center', + }) // Eğer sınıftayken bağlantı koptuysa → tekrar join et if (this.currentSessionId && store.getState().auth.user) { @@ -113,6 +118,13 @@ export class SignalRService { console.warn('šŸ”„ onclose triggered, isKicked=', this.isKicked) if (this.isKicked) { + toast.push( + , + { + placement: 'top-center', + }, + ) + this.isConnected = false this.currentSessionId = undefined return // ā— Kick durumunda kesinlikle LeaveClass Ƨağırma @@ -132,6 +144,9 @@ export class SignalRService { this.connection.on('Error', (message: string) => { console.error('Hub error:', message) + toast.push(, { + placement: 'top-center', + }) }) this.connection.onreconnecting((err) => { @@ -145,6 +160,9 @@ export class SignalRService { this.connection.on('ForceDisconnect', async (message: string) => { console.warn('🚨 ForceDisconnect geldi:', message) this.isKicked = true + toast.push(, { + placement: 'top-center', + }) if (this.onForceCleanup) { console.warn('⚔ ForceCleanup callback Ƨağrılıyor') @@ -180,6 +198,9 @@ export class SignalRService { await Promise.race([startPromise, timeout]) this.isConnected = true + toast.push(, { + placement: 'top-center', + }) } catch (error) { console.error('Error starting SignalR connection:', error) alert( diff --git a/ui/src/services/classroom/webrtc.ts b/ui/src/services/classroom/webrtc.tsx similarity index 100% rename from ui/src/services/classroom/webrtc.ts rename to ui/src/services/classroom/webrtc.tsx diff --git a/ui/src/views/classroom/RoomDetail.tsx b/ui/src/views/classroom/RoomDetail.tsx index 581c126d..f44d9f73 100644 --- a/ui/src/views/classroom/RoomDetail.tsx +++ b/ui/src/views/classroom/RoomDetail.tsx @@ -55,6 +55,8 @@ import DocumentsPanel from '@/components/classroom/panels/DocumentsPanel' import LayoutPanel from '@/components/classroom/panels/LayoutPanel' import { ScreenSharePanel } from '@/components/classroom/panels/ScreenSharePanel' import { ParticipantGrid } from '@/components/classroom/ParticipantGrid' +import toast from '@/components/ui/toast/toast' +import Notification from '@/components/ui/Notification' type SidePanelType = | 'chat' @@ -282,6 +284,9 @@ const RoomDetail: React.FC = () => { if (!isActive) return console.log(`Participant joined: ${name}, isTeacher: ${isTeacher}`) + toast.push(, { + placement: 'top-center', + }) // State’e ekle setParticipants((prev) => { @@ -360,6 +365,9 @@ const RoomDetail: React.FC = () => { signalRServiceRef.current.setParticipantLeaveHandler(({ userId, sessionId }) => { console.log(`Participant left: ${userId} from session ${sessionId}`) + toast.push( p.id === userId)?.name}`} type="warning" />, { + placement: 'top-center', + }) // peer connection’ı kapat webRTCServiceRef.current?.closePeerConnection(userId)