mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
fix: prevent unattended reloading on transcript page (#410)
This commit is contained in:
@@ -52,7 +52,7 @@ const useMp3 = (id: string, waiting?: boolean): Mp3Response => {
|
|||||||
audioElement.preload = "auto";
|
audioElement.preload = "auto";
|
||||||
setMedia(audioElement);
|
setMedia(audioElement);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}, [id, api, later]);
|
}, [id, !api, later]);
|
||||||
|
|
||||||
const getNow = () => {
|
const getNow = () => {
|
||||||
setLater(false);
|
setLater(false);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const useTopics = (id: string): TranscriptTopics => {
|
|||||||
setError(err);
|
setError(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [id, api]);
|
}, [id, !api]);
|
||||||
|
|
||||||
return { topics, loading, error };
|
return { topics, loading, error };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const useWaveform = (id: string, waiting: boolean): AudioWaveFormResponse => {
|
|||||||
setError(err);
|
setError(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [id, api, waiting]);
|
}, [id, !api, waiting]);
|
||||||
|
|
||||||
return { waveform, loading, error };
|
return { waveform, loading, error };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const useWebRTC = (
|
|||||||
const api = useApi();
|
const api = useApi();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!stream || !transcriptId) {
|
if (!stream || !transcriptId || !api) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ const useWebRTC = (
|
|||||||
return () => {
|
return () => {
|
||||||
p.destroy();
|
p.destroy();
|
||||||
};
|
};
|
||||||
}, [stream, transcriptId]);
|
}, [stream, transcriptId, !api]);
|
||||||
|
|
||||||
return peer;
|
return peer;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user