mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
slop removal
This commit is contained in:
@@ -18,7 +18,6 @@ depends_on: Union[str, Sequence[str], None] = None
|
|||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
# Create meeting_consent table
|
|
||||||
op.create_table(
|
op.create_table(
|
||||||
'meeting_consent',
|
'meeting_consent',
|
||||||
sa.Column('id', sa.String(), nullable=False),
|
sa.Column('id', sa.String(), nullable=False),
|
||||||
@@ -32,5 +31,4 @@ def upgrade() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
# Drop meeting_consent table
|
|
||||||
op.drop_table('meeting_consent')
|
op.drop_table('meeting_consent')
|
||||||
@@ -13,8 +13,6 @@ import useMp3 from "../../useMp3";
|
|||||||
import WaveformLoading from "../../waveformLoading";
|
import WaveformLoading from "../../waveformLoading";
|
||||||
import { Box, Text, Grid, Heading, VStack, Flex } from "@chakra-ui/react";
|
import { Box, Text, Grid, Heading, VStack, Flex } from "@chakra-ui/react";
|
||||||
import LiveTrancription from "../../liveTranscription";
|
import LiveTrancription from "../../liveTranscription";
|
||||||
import AudioConsentDialog from "../../../rooms/audioConsentDialog";
|
|
||||||
import useApi from "../../../../lib/useApi";
|
|
||||||
|
|
||||||
type TranscriptDetails = {
|
type TranscriptDetails = {
|
||||||
params: {
|
params: {
|
||||||
@@ -26,9 +24,6 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
|||||||
const transcript = useTranscript(details.params.transcriptId);
|
const transcript = useTranscript(details.params.transcriptId);
|
||||||
const [transcriptStarted, setTranscriptStarted] = useState(false);
|
const [transcriptStarted, setTranscriptStarted] = useState(false);
|
||||||
const useActiveTopic = useState<Topic | null>(null);
|
const useActiveTopic = useState<Topic | null>(null);
|
||||||
const [showConsentDialog, setShowConsentDialog] = useState(false);
|
|
||||||
const [consentStatus, setConsentStatus] = useState<string>('');
|
|
||||||
const api = useApi();
|
|
||||||
|
|
||||||
const webSockets = useWebSockets(details.params.transcriptId);
|
const webSockets = useWebSockets(details.params.transcriptId);
|
||||||
|
|
||||||
@@ -69,53 +64,7 @@ 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 (
|
return (
|
||||||
<>
|
|
||||||
<AudioConsentDialog
|
|
||||||
isOpen={showConsentDialog}
|
|
||||||
onClose={() => setShowConsentDialog(false)}
|
|
||||||
onConsent={handleConsentResponse}
|
|
||||||
/>
|
|
||||||
<Grid
|
<Grid
|
||||||
templateColumns="1fr"
|
templateColumns="1fr"
|
||||||
templateRows="auto minmax(0, 1fr) "
|
templateRows="auto minmax(0, 1fr) "
|
||||||
@@ -175,7 +124,6 @@ const TranscriptRecord = (details: TranscriptDetails) => {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</VStack>
|
</VStack>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user