Merge branch 'main' of github.com:presenton/presenton
This commit is contained in:
commit
2b5d58be8c
5 changed files with 18 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ const DocumentsPreviewPage: React.FC = () => {
|
|||
});
|
||||
|
||||
dispatch(setPresentationId(createResponse.id));
|
||||
router.push("/outline");
|
||||
router.replace("/outline");
|
||||
} catch (error: any) {
|
||||
console.error("Error in radar presentation creation:", error);
|
||||
toast.error('Error', {
|
||||
|
|
|
|||
|
|
@ -85,11 +85,11 @@ export const useOutlineStreaming = (presentationId: string | null) => {
|
|||
} catch (error) {
|
||||
setStreamState({ isStreaming: false, isLoading: false });
|
||||
toast.error("Failed to initialize connection");
|
||||
}finally{
|
||||
setStreamState({ isStreaming: false, isLoading: false });
|
||||
}
|
||||
};
|
||||
|
||||
initializeStream();
|
||||
|
||||
initializeStream();
|
||||
return () => {
|
||||
if (eventSource) {
|
||||
eventSource.close();
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export const usePresentationGeneration = (
|
|||
|
||||
if (response) {
|
||||
dispatch(clearPresentationData());
|
||||
router.push(`/presentation?id=${presentationId}&stream=true`);
|
||||
router.replace(`/presentation?id=${presentationId}&stream=true`);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('Error In Presentation Generation(prepare).', error);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
setStreaming,
|
||||
} from "@/store/slices/presentationGeneration";
|
||||
import { jsonrepair } from "jsonrepair";
|
||||
import { RootState } from "@/store/store";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export const usePresentationStreaming = (
|
||||
presentationId: string,
|
||||
|
|
@ -89,6 +89,17 @@ export const usePresentationStreaming = (
|
|||
newUrl.searchParams.delete("stream");
|
||||
window.history.replaceState({}, "", newUrl.toString());
|
||||
break;
|
||||
case "error":
|
||||
eventSource.close();
|
||||
toast.error("Error in outline streaming", {
|
||||
description:
|
||||
data.detail ||
|
||||
"Failed to connect to the server. Please try again.",
|
||||
});
|
||||
setLoading(false);
|
||||
dispatch(setStreaming(false));
|
||||
setError(true);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ const UploadPage = () => {
|
|||
config,
|
||||
files: responses,
|
||||
}));
|
||||
dispatch(clearOutlines());
|
||||
router.push("/documents-preview");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue