minor improvements

This commit is contained in:
Sara
2023-11-03 11:12:17 +01:00
parent d9cf29123c
commit fc0ecaa3d5
2 changed files with 5 additions and 2 deletions

View File

@@ -26,6 +26,9 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
const { setError } = useError();
const router = useRouter();
const { websocket_url } = useContext(DomainContext);
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
useEffect(() => {
if (isProcessing || textQueue.length === 0) {
return;
@@ -149,8 +152,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
};
if (!transcriptId) return;
const { websocket_url } = useContext(DomainContext);
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
const ws = new WebSocket(url);
ws.onopen = () => {