From c32809fe641f8e1c2159453fee26145619fa6f97 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Tue, 20 Aug 2024 13:48:43 +0300 Subject: [PATCH] Display user friendly message on unlink form --- src/pages/signin/UnlinkLoginForm.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/signin/UnlinkLoginForm.tsx b/src/pages/signin/UnlinkLoginForm.tsx index 2fa43fbe61b2..9ccbbaaa56cd 100644 --- a/src/pages/signin/UnlinkLoginForm.tsx +++ b/src/pages/signin/UnlinkLoginForm.tsx @@ -32,6 +32,7 @@ function UnlinkLoginForm({account, credentials}: UnlinkLoginFormProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const {isOffline} = useNetwork(); + const unlinkMessage = account?.message === 'unlinkLoginForm.linkSent' || account?.message === 'unlinkLoginForm.succesfullyUnlinkedLogin' ? translate(account?.message) : account?.message; const primaryLogin = useMemo(() => { if (!account?.primaryLogin) { return ''; @@ -53,13 +54,13 @@ function UnlinkLoginForm({account, credentials}: UnlinkLoginFormProps) { {translate('unlinkLoginForm.noLongerHaveAccess', {primaryLogin})} - {!!account?.message && ( + {!!unlinkMessage && ( // DotIndicatorMessage mostly expects onyxData errors, so we need to mock an object so that the messages looks similar to prop.account.errors )} {!!account?.errors && !isEmptyObject(account.errors) && (