diff --git a/src/app/organisms/room/message/AudioContent.tsx b/src/app/organisms/room/message/AudioContent.tsx index eae5447..83e5dc0 100644 --- a/src/app/organisms/room/message/AudioContent.tsx +++ b/src/app/organisms/room/message/AudioContent.tsx @@ -45,7 +45,8 @@ export const AudioContent = as<'div', AudioContentProps>( const [currentTime, setCurrentTime] = useState(0); // duration in seconds. (NOTE: info.duration is in milliseconds) - const [duration, setDuration] = useState((info.duration ?? 0) / 1000); + const infoDuration = info.duration ?? 0; + const [duration, setDuration] = useState((infoDuration >= 0 ? infoDuration : 0) / 1000); const getAudioRef = useCallback(() => audioRef.current, []); const { loading } = useMediaLoading(getAudioRef);