Skip to content

Commit 0bb5fe9

Browse files
committed
show reddit errors in modal
1 parent 3cfca8d commit 0bb5fe9

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/app/layout.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import "./globals.css";
77
export const metadata: Metadata = {
88
metadataBase: new URL("https://storytomanga.com"),
99
title: "Story to Manga Machine",
10-
description:
11-
"Transform stories into manga and comic pages with IA",
10+
description: "Transform stories into manga and comic pages with AI",
1211
openGraph: {
1312
title: "Story to Manga",
14-
description:
15-
"Transform stories into manga and comic pages with IA",
13+
description: "Transform stories into manga and comic pages with AI",
1614
url: "https://storytomanga.com",
1715
images: [
1816
{
@@ -27,8 +25,7 @@ export const metadata: Metadata = {
2725
twitter: {
2826
card: "summary_large_image",
2927
title: "Story to Manga",
30-
description:
31-
"Transform stories into manga and comic pages with IA",
28+
description: "Transform stories into manga and comic pages with AI",
3229
images: ["/og-image.png"],
3330
},
3431
};

src/app/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ export default function Home() {
104104
setGeneratedPanels,
105105
setFailedStep,
106106
setFailedPanel,
107-
showError,
108107
clearResults,
109108
setOpenAccordions,
110109
toggleGenerationAccordion,
@@ -132,6 +131,7 @@ export default function Home() {
132131
openImageModal,
133132
closeImageModal,
134133
setShowConfirmClearModal,
134+
showError,
135135
closeErrorModal,
136136
setIsLoadingState,
137137
setIsSavingState,
@@ -250,6 +250,7 @@ export default function Home() {
250250
setIsLoadingReddit,
251251
setCurrentStepText,
252252
setStory,
253+
showError,
253254
style,
254255
uploadedCharacterReferences,
255256
uploadedSettingReferences,

src/hooks/useRedditIntegration.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface UseRedditIntegrationProps {
1717
setIsLoadingReddit: (loading: boolean) => void;
1818
setCurrentStepText: (text: string) => void;
1919
setStory: (story: string) => void;
20+
showError: (message: string) => void;
2021
style: ComicStyle;
2122
uploadedCharacterReferences: UploadedCharacterReference[];
2223
uploadedSettingReferences: UploadedSettingReference[];
@@ -35,6 +36,7 @@ export function useRedditIntegration(props: UseRedditIntegrationProps) {
3536
setIsLoadingReddit,
3637
setCurrentStepText,
3738
setStory,
39+
showError,
3840
style,
3941
uploadedCharacterReferences,
4042
uploadedSettingReferences,
@@ -82,16 +84,13 @@ export function useRedditIntegration(props: UseRedditIntegrationProps) {
8284
errorMessage = error.message;
8385
}
8486

85-
// Show error in the current step text
86-
setCurrentStepText(`Error: ${errorMessage}`);
87+
// Show error in a modal
88+
showError(errorMessage);
8789

8890
trackError("reddit_loading", errorMessage);
8991

90-
// Clear error after a few seconds
91-
setTimeout(() => {
92-
setCurrentStepText("");
93-
setIsLoadingReddit(false);
94-
}, 3000);
92+
setIsLoadingReddit(false);
93+
setCurrentStepText("");
9594

9695
return;
9796
}
@@ -107,6 +106,7 @@ export function useRedditIntegration(props: UseRedditIntegrationProps) {
107106
setIsLoadingReddit,
108107
setCurrentStepText,
109108
setStory,
109+
showError,
110110
style,
111111
uploadedCharacterReferences,
112112
uploadedSettingReferences,

0 commit comments

Comments
 (0)