Urgent Fix for "Rules of Hooks" error

This commit is contained in:
Koper
2023-08-22 18:07:31 +07:00
parent c1298043fa
commit a91c453e41
2 changed files with 4 additions and 4 deletions

View File

@@ -5,11 +5,11 @@ import {
V1TranscriptRecordWebrtcRequest,
} from "../api/apis/DefaultApi";
import { Configuration } from "../api/runtime";
import getApi from "../lib/getApi";
const useWebRTC = (
stream: MediaStream | null,
transcriptId: string | null,
api: DefaultApi,
): Peer => {
const [peer, setPeer] = useState<Peer | null>(null);
@@ -18,8 +18,6 @@ const useWebRTC = (
return;
}
const api = getApi();
let p: Peer = new Peer({ initiator: true, stream: stream });
p.on("signal", (data: any) => {