www: remove auth changes (will be done by sara PR)

This commit is contained in:
2023-11-02 16:41:06 +01:00
committed by Mathieu Virbel
parent dbf3c9fd2c
commit f5ce3dd75e

View File

@@ -14,8 +14,6 @@ import DisconnectedIndicator from "../../disconnectedIndicator";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGear } from "@fortawesome/free-solid-svg-icons";
import { lockWakeState, releaseWakeState } from "../../../../lib/wakeLock";
import { featRequireLogin } from "../../../../../app/lib/utils";
import { useFiefIsAuthenticated } from "@fief/fief/nextjs/react";
type TranscriptDetails = {
params: {
@@ -38,23 +36,16 @@ const TranscriptRecord = (details: TranscriptDetails) => {
}
}, []);
const isAuthenticated = useFiefIsAuthenticated();
const api = getApi();
const [transcriptId, setTranscriptId] = useState<string>("");
const transcript = useTranscript(api, transcriptId);
const webRTC = useWebRTC(stream, transcriptId, api);
const webSockets = useWebSockets(transcriptId);
const transcript = useTranscript(api, details.params.transcriptId);
const webRTC = useWebRTC(stream, details.params.transcriptId, api);
const webSockets = useWebSockets(details.params.transcriptId);
const { audioDevices, getAudioStream } = useAudioDevice();
const [hasRecorded, setHasRecorded] = useState(false);
const [transcriptStarted, setTranscriptStarted] = useState(false);
useEffect(() => {
if (featRequireLogin() && !isAuthenticated) return;
setTranscriptId(details.params.transcriptId);
}, [api, details.params.transcriptId, isAuthenticated]);
useEffect(() => {
if (!transcriptStarted && webSockets.transcriptText.length !== 0)
setTranscriptStarted(true);