notification if telegram server is not reachable

main
alex 2023-11-04 22:03:59 +01:00
parent a8fa795be4
commit 0ff022d42e
3 changed files with 22 additions and 13 deletions

View File

@ -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"
}
}
},

View File

@ -299,7 +299,8 @@ export default function UserProfile({ userSession, setUserSession }) {
{},
myFetchContentType.JSON,
Constants.TELEGRAM_BOT_MANAGER_ADDRESS
).then((data) => {
)
.then((data) => {
// manual check verify status by clicking reload icon
if (!updateOnlyOnVerified) {
setTelegramNotificationSubscribedStatus(data.Status);
@ -311,7 +312,13 @@ export default function UserProfile({ userSession, setUserSession }) {
clearInterval(statusInterval.current);
telegramVerifyCodeRequestTime.current = null;
}
});
})
.catch(() =>
notificationApi["error"]({
message: t("userProfile.telegram.connectionFailedPopover.title"),
description: t("common.contactAdmin"),
})
);
const TelegramNotificationSubscribedStatusItem = () => {
// check verified status

View File

@ -1449,7 +1449,6 @@ export function myFetch(
return response.text();
})
.catch((error) => {
console.error("myFetch error:", error);
throw error;
});
}