mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
www: fix loading of past transcript before the user is authenticated
This commit is contained in:
@@ -13,15 +13,14 @@ type TranscriptTopics = {
|
||||
error: Error | null;
|
||||
};
|
||||
|
||||
const useTranscript = (api: DefaultApi, id: string): TranscriptTopics => {
|
||||
const useTopics = (api: DefaultApi, id: string): TranscriptTopics => {
|
||||
const [topics, setTopics] = useState<Topic[] | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [error, setErrorState] = useState<Error | null>(null);
|
||||
const { setError } = useError();
|
||||
|
||||
const getTopics = (id: string) => {
|
||||
if (!id)
|
||||
throw new Error("Transcript ID is required to get transcript topics");
|
||||
if (!id) return;
|
||||
|
||||
setLoading(true);
|
||||
const requestParameters: V1TranscriptGetTopicsRequest = {
|
||||
@@ -47,4 +46,4 @@ const useTranscript = (api: DefaultApi, id: string): TranscriptTopics => {
|
||||
return { topics, loading, error };
|
||||
};
|
||||
|
||||
export default useTranscript;
|
||||
export default useTopics;
|
||||
|
||||
Reference in New Issue
Block a user