fix: prevent unattended reloading on transcript page (#410)

This commit is contained in:
2024-09-10 18:35:33 -06:00
committed by GitHub
parent 50ad721afa
commit 6c4eac04c1
4 changed files with 5 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ const useMp3 = (id: string, waiting?: boolean): Mp3Response => {
audioElement.preload = "auto";
setMedia(audioElement);
setLoading(false);
}, [id, api, later]);
}, [id, !api, later]);
const getNow = () => {
setLater(false);

View File

@@ -38,7 +38,7 @@ const useTopics = (id: string): TranscriptTopics => {
setError(err);
}
});
}, [id, api]);
}, [id, !api]);
return { topics, loading, error };
};

View File

@@ -36,7 +36,7 @@ const useWaveform = (id: string, waiting: boolean): AudioWaveFormResponse => {
setError(err);
}
});
}, [id, api, waiting]);
}, [id, !api, waiting]);
return { waveform, loading, error };
};

View File

@@ -13,7 +13,7 @@ const useWebRTC = (
const api = useApi();
useEffect(() => {
if (!stream || !transcriptId) {
if (!stream || !transcriptId || !api) {
return;
}
@@ -63,7 +63,7 @@ const useWebRTC = (
return () => {
p.destroy();
};
}, [stream, transcriptId]);
}, [stream, transcriptId, !api]);
return peer;
};