update audio-deleted flow

This commit is contained in:
Igor Loskutov
2025-06-18 15:43:34 -04:00
parent 6cb6d90b9a
commit c23e0e07ef
15 changed files with 282 additions and 76 deletions

View File

@@ -183,7 +183,18 @@ const TopicPlayer = ({
setIsPlaying(false);
};
const isLoaded = !!(mp3.media && topicTime);
const isLoaded = !!(mp3.loading && topicTime);
const error = mp3.error;
if (error !== null) {
return <Text fontSize="sm" pt="1" pl="2">
Loading error: {error}
</Text>
}
if (mp3.audioDeleted) {
return <Text fontSize="sm" pt="1" pl="2">
This topic file has been deleted.
</Text>
}
return (
<Skeleton
isLoaded={isLoaded}

View File

@@ -54,10 +54,30 @@ export default function TranscriptDetails(details: TranscriptDetails) {
);
}
if (mp3.audioDeleted) {
return (
<Modal
title="Can't find transcription: Transcription file is deleted"
text={`The recording is deleted.`}
/>
);
}
if (transcript?.loading || topics?.loading) {
return <Modal title="Loading" text={"Loading transcript..."} />;
}
if (mp3.error) {
return (
<Modal
title="Transcription error"
text={`There was an error loading the recording. Error: ${mp3.error}`}
/>
);
}
return (
<>
<Grid

View File

@@ -27,7 +27,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
const webSockets = useWebSockets(details.params.transcriptId);
let mp3 = useMp3(details.params.transcriptId, true);
const mp3 = useMp3(details.params.transcriptId, true);
const router = useRouter();

View File

@@ -21,7 +21,7 @@ const TranscriptUpload = (details: TranscriptUpload) => {
const webSockets = useWebSockets(details.params.transcriptId);
let mp3 = useMp3(details.params.transcriptId, true);
const mp3 = useMp3(details.params.transcriptId, true);
const router = useRouter();