mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-22 21:29:05 +00:00
fix api auth
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
"use client";
|
||||
import Modal from "../modal";
|
||||
import getApi from "../../../lib/getApi";
|
||||
import useTranscript from "../useTranscript";
|
||||
import useTopics from "../useTopics";
|
||||
import useWaveform from "../useWaveform";
|
||||
import { TopicList } from "../topicList";
|
||||
import Recorder from "../recorder";
|
||||
import { Topic } from "../webSocketTypes";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
import "../../../styles/button.css";
|
||||
import FinalSummary from "../finalSummary";
|
||||
import ShareLink from "../shareLink";
|
||||
import QRCode from "react-qr-code";
|
||||
import TranscriptTitle from "../transcriptTitle";
|
||||
import { useFiefIsAuthenticated } from "@fief/fief/nextjs/react";
|
||||
import { featureEnabled } from "../../domainContext";
|
||||
|
||||
type TranscriptDetails = {
|
||||
params: {
|
||||
@@ -22,20 +19,15 @@ type TranscriptDetails = {
|
||||
};
|
||||
};
|
||||
|
||||
export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
const isAuthenticated = useFiefIsAuthenticated();
|
||||
const api = getApi();
|
||||
const [transcriptId, setTranscriptId] = useState<string>("");
|
||||
const transcript = useTranscript(api, transcriptId);
|
||||
const topics = useTopics(api, transcriptId);
|
||||
const waveform = useWaveform(api, transcriptId);
|
||||
const useActiveTopic = useState<Topic | null>(null);
|
||||
const requireLogin = featureEnabled("requireLogin");
|
||||
const protectedPath = true;
|
||||
|
||||
useEffect(() => {
|
||||
if (requireLogin && !isAuthenticated) return;
|
||||
setTranscriptId(details.params.transcriptId);
|
||||
}, [api]);
|
||||
export default function TranscriptDetails(details: TranscriptDetails) {
|
||||
const transcriptId = details.params.transcriptId;
|
||||
|
||||
const transcript = useTranscript(protectedPath, transcriptId);
|
||||
const topics = useTopics(protectedPath, transcriptId);
|
||||
const waveform = useWaveform(protectedPath, transcriptId);
|
||||
const useActiveTopic = useState<Topic | null>(null);
|
||||
|
||||
if (transcript?.error /** || topics?.error || waveform?.error **/) {
|
||||
return (
|
||||
|
||||
@@ -36,9 +36,8 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const api = getApi();
|
||||
const transcript = useTranscript(api, details.params.transcriptId);
|
||||
const webRTC = useWebRTC(stream, details.params.transcriptId, api);
|
||||
const transcript = useTranscript(false, details.params.transcriptId);
|
||||
const webRTC = useWebRTC(stream, details.params.transcriptId, true);
|
||||
const webSockets = useWebSockets(details.params.transcriptId);
|
||||
|
||||
const { audioDevices, getAudioStream } = useAudioDevice();
|
||||
|
||||
Reference in New Issue
Block a user