diff --git a/src/events/actions/sessions/generation/useSessionsGenerationGeneric.ts b/src/events/actions/sessions/generation/useSessionsGenerationGeneric.ts index 7025229..9ed78d2 100644 --- a/src/events/actions/sessions/generation/useSessionsGenerationGeneric.ts +++ b/src/events/actions/sessions/generation/useSessionsGenerationGeneric.ts @@ -56,6 +56,7 @@ export const useSessionsGenerationGeneric = < ): Promise<{ success: boolean results: any[] + message?: string }> => { const sessionsCount = sessions.length @@ -82,6 +83,9 @@ export const useSessionsGenerationGeneric = < return { success: false, results: [], + message: + answer.message || + 'Unknown error while generating the video/image, you may want to switch the ShortVid server', } } diff --git a/src/events/page/sessions/components/GenerateSessionsVideoDialog.tsx b/src/events/page/sessions/components/GenerateSessionsVideoDialog.tsx index e549b71..79e9fd4 100644 --- a/src/events/page/sessions/components/GenerateSessionsVideoDialog.tsx +++ b/src/events/page/sessions/components/GenerateSessionsVideoDialog.tsx @@ -66,7 +66,7 @@ export const GenerateSessionsVideoDialog = ({ ...shortVidSetting, updateSession: updateDoc, }) - .then(({ success, results }: GeneratedSessionVideoAnswer) => { + .then(({ success, results, message }: GeneratedSessionVideoAnswer) => { if (success && results.length) { const text = onSuccess ? 'Video generation done!' : 'Video generation done, sessions updated!' if (onSuccess) { @@ -76,7 +76,7 @@ export const GenerateSessionsVideoDialog = ({ onClose() } else { createNotification( - 'Error while generating the video/image, you may want to switch the ShortVid server', + message || 'Error while generating the video/image, you may want to switch the ShortVid server', { type: 'error' } ) } @@ -145,6 +145,9 @@ export const GenerateSessionsVideoDialog = ({ {generatingState.generationState === GenerationStates.ERROR && ( {generatingState.message} )} + {finalGeneration.generatingState.generationState === GenerationStates.ERROR && ( + {finalGeneration.generatingState.message} + )} {generatingState.generationState === GenerationStates.SUCCESS && ( <>