From fdf42cf60b381cc0606bbd0511ca0a633188e1ec Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Tue, 17 Jun 2025 19:48:46 -0400 Subject: [PATCH] slop removal --- ...0250617140003_add_meeting_consent_table.py | 2 - .../[transcriptId]/record/page.tsx | 66 ++----------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/server/migrations/versions/20250617140003_add_meeting_consent_table.py b/server/migrations/versions/20250617140003_add_meeting_consent_table.py index f4cfef81..ae85219c 100644 --- a/server/migrations/versions/20250617140003_add_meeting_consent_table.py +++ b/server/migrations/versions/20250617140003_add_meeting_consent_table.py @@ -18,7 +18,6 @@ depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: - # Create meeting_consent table op.create_table( 'meeting_consent', sa.Column('id', sa.String(), nullable=False), @@ -32,5 +31,4 @@ def upgrade() -> None: def downgrade() -> None: - # Drop meeting_consent table op.drop_table('meeting_consent') \ No newline at end of file diff --git a/www/app/(app)/transcripts/[transcriptId]/record/page.tsx b/www/app/(app)/transcripts/[transcriptId]/record/page.tsx index 009fc519..2d227f57 100644 --- a/www/app/(app)/transcripts/[transcriptId]/record/page.tsx +++ b/www/app/(app)/transcripts/[transcriptId]/record/page.tsx @@ -13,8 +13,6 @@ import useMp3 from "../../useMp3"; import WaveformLoading from "../../waveformLoading"; import { Box, Text, Grid, Heading, VStack, Flex } from "@chakra-ui/react"; import LiveTrancription from "../../liveTranscription"; -import AudioConsentDialog from "../../../rooms/audioConsentDialog"; -import useApi from "../../../../lib/useApi"; type TranscriptDetails = { params: { @@ -26,9 +24,6 @@ const TranscriptRecord = (details: TranscriptDetails) => { const transcript = useTranscript(details.params.transcriptId); const [transcriptStarted, setTranscriptStarted] = useState(false); const useActiveTopic = useState(null); - const [showConsentDialog, setShowConsentDialog] = useState(false); - const [consentStatus, setConsentStatus] = useState(''); - const api = useApi(); const webSockets = useWebSockets(details.params.transcriptId); @@ -69,60 +64,14 @@ const TranscriptRecord = (details: TranscriptDetails) => { }; }, []); - // Show consent dialog when recording starts and meeting_id is available - useEffect(() => { - if (status === "recording" && transcript.response?.meeting_id && !consentStatus) { - setShowConsentDialog(true); - } - }, [status, transcript.response?.meeting_id, consentStatus]); - - const handleConsentResponse = async (consentGiven: boolean) => { - const meetingId = transcript.response?.meeting_id; - if (!meetingId || !api) { - console.error('No meeting_id available or API not initialized'); - return; - } - - try { - // Use a simple user identifier - could be improved with actual user ID - const userIdentifier = `user_${Date.now()}`; - - const response = await fetch(`/v1/meetings/${meetingId}/consent`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - consent_given: consentGiven, - user_identifier: userIdentifier - }) - }); - - if (response.ok) { - setConsentStatus(consentGiven ? 'given' : 'denied'); - console.log('Consent recorded successfully'); - } else { - console.error('Failed to record consent'); - } - } catch (error) { - console.error('Error recording consent:', error); - } - }; - return ( - <> - setShowConsentDialog(false)} - onConsent={handleConsentResponse} - /> - + {status == "processing" ? ( ) : ( @@ -175,7 +124,6 @@ const TranscriptRecord = (details: TranscriptDetails) => { - ); };