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

@ -50,11 +50,15 @@ window.fetch = async(url, option = {}) => {
requestFilters.forEach(filter => filter(url, option));
return new Promise((resolve, reject) => {
originalFetch(url, option).then(res => {
if (!url.startsWith("/api/get-organizations")) {
responseFilters.forEach(filter => filter(res.clone()));
}
resolve(res);
});
originalFetch(url, option)
.then(res => {
if (!url.startsWith("/api/get-organizations")) {
responseFilters.forEach(filter => filter(res.clone()));
}
resolve(res);
})
.catch(error => {
reject(error);
});
});
};