add config cicd
Some checks failed
Deploy on Master Change / deploy (push) Failing after 15s

This commit is contained in:
2026-07-01 07:39:55 +07:00
parent 7b3f29ee73
commit 42fc2d9136
4 changed files with 84 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef } from 'react';
import { type ChatMessage } from '../api';
import { type ChatMessage, getWsUrl } from '../api';
import { useAuth } from '../auth/AuthContext';
import { playChatSound } from '../utils/notifySound';
@@ -28,8 +28,7 @@ export function StaffChatSocket() {
useEffect(() => {
if (!token || !staff?.id) return;
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsUrl = `${protocol}//${window.location.hostname}:8080/ws?role=teacher&staffId=${staff.id}`;
const wsUrl = getWsUrl(`/ws?role=teacher&staffId=${staff.id}`);
let ws: WebSocket | null = null;
let retryTimer: ReturnType<typeof setTimeout> | null = null;
let closed = false;