notification if telegram server is not reachable
parent
a8fa795be4
commit
0ff022d42e
|
@ -440,6 +440,9 @@
|
||||||
"verificationPopover": {
|
"verificationPopover": {
|
||||||
"title": "Verification",
|
"title": "Verification",
|
||||||
"description": "Add the bot on your telegram account and send the command {{command}} to the bot"
|
"description": "Add the bot on your telegram account and send the command {{command}} to the bot"
|
||||||
|
},
|
||||||
|
"connectionFailedPopover": {
|
||||||
|
"title": "Failed to get telegram verify status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -299,19 +299,26 @@ export default function UserProfile({ userSession, setUserSession }) {
|
||||||
{},
|
{},
|
||||||
myFetchContentType.JSON,
|
myFetchContentType.JSON,
|
||||||
Constants.TELEGRAM_BOT_MANAGER_ADDRESS
|
Constants.TELEGRAM_BOT_MANAGER_ADDRESS
|
||||||
).then((data) => {
|
)
|
||||||
// manual check verify status by clicking reload icon
|
.then((data) => {
|
||||||
if (!updateOnlyOnVerified) {
|
// manual check verify status by clicking reload icon
|
||||||
setTelegramNotificationSubscribedStatus(data.Status);
|
if (!updateOnlyOnVerified) {
|
||||||
}
|
setTelegramNotificationSubscribedStatus(data.Status);
|
||||||
|
}
|
||||||
|
|
||||||
// used for auto check verify status
|
// used for auto check verify status
|
||||||
if (data.Status === true) {
|
if (data.Status === true) {
|
||||||
setTelegramNotificationSubscribedStatus(data.Status);
|
setTelegramNotificationSubscribedStatus(data.Status);
|
||||||
clearInterval(statusInterval.current);
|
clearInterval(statusInterval.current);
|
||||||
telegramVerifyCodeRequestTime.current = null;
|
telegramVerifyCodeRequestTime.current = null;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(() =>
|
||||||
|
notificationApi["error"]({
|
||||||
|
message: t("userProfile.telegram.connectionFailedPopover.title"),
|
||||||
|
description: t("common.contactAdmin"),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const TelegramNotificationSubscribedStatusItem = () => {
|
const TelegramNotificationSubscribedStatusItem = () => {
|
||||||
// check verified status
|
// check verified status
|
||||||
|
|
|
@ -1449,7 +1449,6 @@ export function myFetch(
|
||||||
return response.text();
|
return response.text();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("myFetch error:", error);
|
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue