Improve termsOfUse UI and error handling

This commit is contained in:
Yang Luo
2023-09-07 10:32:49 +08:00
parent ca6b27f922
commit 3459ef1479
3 changed files with 16 additions and 8 deletions

View File

@ -49,7 +49,11 @@ export const AgreementModal = (props) => {
function getTermsOfUseContent(url) {
return fetch(url, {
method: "GET",
}).then(r => r.text());
})
.then(r => r.text())
.catch(error => {
Setting.showMessage("error", `${i18next.t("general:Failed to get TermsOfUse URL")}: ${url}, ${error}`);
});
}
export function isAgreementRequired(application) {