diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index e8ab29b..0485bcb 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -440,6 +440,9 @@ "verificationPopover": { "title": "Verification", "description": "Add the bot on your telegram account and send the command {{command}} to the bot" + }, + "connectionFailedPopover": { + "title": "Failed to get telegram verify status" } } }, diff --git a/src/Pages/UserProfile/index.js b/src/Pages/UserProfile/index.js index 95951f9..491c43d 100644 --- a/src/Pages/UserProfile/index.js +++ b/src/Pages/UserProfile/index.js @@ -299,19 +299,26 @@ export default function UserProfile({ userSession, setUserSession }) { {}, myFetchContentType.JSON, Constants.TELEGRAM_BOT_MANAGER_ADDRESS - ).then((data) => { - // manual check verify status by clicking reload icon - if (!updateOnlyOnVerified) { - setTelegramNotificationSubscribedStatus(data.Status); - } + ) + .then((data) => { + // manual check verify status by clicking reload icon + if (!updateOnlyOnVerified) { + setTelegramNotificationSubscribedStatus(data.Status); + } - // used for auto check verify status - if (data.Status === true) { - setTelegramNotificationSubscribedStatus(data.Status); - clearInterval(statusInterval.current); - telegramVerifyCodeRequestTime.current = null; - } - }); + // used for auto check verify status + if (data.Status === true) { + setTelegramNotificationSubscribedStatus(data.Status); + clearInterval(statusInterval.current); + telegramVerifyCodeRequestTime.current = null; + } + }) + .catch(() => + notificationApi["error"]({ + message: t("userProfile.telegram.connectionFailedPopover.title"), + description: t("common.contactAdmin"), + }) + ); const TelegramNotificationSubscribedStatusItem = () => { // check verified status diff --git a/src/utils.js b/src/utils.js index 631931f..dff07e2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1449,7 +1449,6 @@ export function myFetch( return response.text(); }) .catch((error) => { - console.error("myFetch error:", error); throw error; }); }