mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
update audio-deleted flow
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user