From e816f0afc816335cb64f07f6546e7502b142e8d7 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 17 Oct 2024 10:58:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(frontend)=20add=20toast=20error=20?= =?UTF-8?q?when=20AI=20request=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the AI request fails, a toast error is displayed to the user. --- .../impress/src/features/docs/doc-editor/components/AIButton.tsx | 1 + src/frontend/apps/impress/src/i18n/translations.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/AIButton.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/AIButton.tsx index b0987792..bf5d524f 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/AIButton.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/AIButton.tsx @@ -374,6 +374,7 @@ const useHandleAIError = () => { }); } + toast(t('AI seems busy! Please try again.'), VariantType.ERROR); console.error(error); }, [toast, t], diff --git a/src/frontend/apps/impress/src/i18n/translations.json b/src/frontend/apps/impress/src/i18n/translations.json index 2e377f13..d2bf8aae 100644 --- a/src/frontend/apps/impress/src/i18n/translations.json +++ b/src/frontend/apps/impress/src/i18n/translations.json @@ -5,6 +5,7 @@ "\"{{email}}\" is already invited to the document.": "\"{{email}}\" est déjà invité à accéder au document.", "\"{{email}}\" is already member of the document.": "\"{{email}}\" est déjà membre du document.", "AI Actions": "Actions IA", + "AI seems busy! Please try again.": "L'IA semble occupée ! Veuillez réessayer.", "Accessibility": "Accessibilité", "Accessibility statement": "Déclaration d'accessibilité", "Address:": "Adresse :",