diff --git a/src/renderer/src/components/WSAudioPlayer.tsx b/src/renderer/src/components/WSAudioPlayer.tsx index e4a6a28d..fa2fdce3 100644 --- a/src/renderer/src/components/WSAudioPlayer.tsx +++ b/src/renderer/src/components/WSAudioPlayer.tsx @@ -1097,7 +1097,6 @@ function WSAudioPlayer(props: IProps) { }; const handleChanged = useCallback(async () => { - setChanged && setChanged(durationRef.current !== 0); setBlobReady && setBlobReady(false); wsBlob().then((newblob) => { onBlobReady && onBlobReady(newblob); @@ -1105,6 +1104,7 @@ function WSAudioPlayer(props: IProps) { if (setMimeType && newblob?.type) setMimeType(newblob?.type); setDuration(wsDuration()); setProgress(wsPosition()); + setChanged && setChanged(durationRef.current !== 0); }); }, [ setChanged, @@ -1163,8 +1163,9 @@ function WSAudioPlayer(props: IProps) { }); }; const handleUndo = useCallback(() => { - wsUndo(); - handleChanged(); + wsUndo().then(() => { + handleChanged(); + }); }, [wsUndo, handleChanged]); useEffect(() => { if (!controlsRef) return;