This commit is contained in:
Mirco Wittrien 2023-10-20 14:32:21 +02:00
parent 0e497b57f5
commit e5ea4eb65a
2 changed files with 4 additions and 4 deletions

View File

@ -787,7 +787,7 @@ module.exports = (_ => {
}
};
BDFDB.LibraryRequires.request("https://api.betterdiscord.app/v1/store/plugins", {bdVersion: true}, (error, response, body) => {
BDFDB.TimeUtils.timeout(_ => BDFDB.LibraryRequires.request("https://api.betterdiscord.app/v1/store/plugins", {bdVersion: true}, (error, response, body) => {
if (!error && body && response.statusCode == 200) try {
grabbedPlugins = BDFDB.ArrayUtils.keySort(JSON.parse(body).filter(n => n), "name");
BDFDB.DataUtils.save(BDFDB.ArrayUtils.numSort(grabbedPlugins.map(n => n.id)).join(" "), this, "cached");
@ -819,7 +819,7 @@ module.exports = (_ => {
catch (err) {BDFDB.NotificationUtils.toast("Failed to load Plugin Store", {type: "danger"});}
if (response && response.statusCode == 403) BDFDB.NotificationUtils.toast("Failed to fetch Plugin Store from the Website Api due to DDoS Protection", {type: "danger"});
else if (response && response.statusCode == 404) BDFDB.NotificationUtils.toast("Failed to fetch Plugin Store from the Website Api due to Connection Issue", {type: "danger"});
});
}), 10000);
}
getLoadingTooltipText () {

View File

@ -968,7 +968,7 @@ module.exports = (_ => {
}
};
BDFDB.LibraryRequires.request("https://api.betterdiscord.app/v1/store/themes", {bdVersion: true}, (error, response, body) => {
BDFDB.TimeUtils.timeout(_ => BDFDB.LibraryRequires.request("https://api.betterdiscord.app/v1/store/themes", {bdVersion: true}, (error, response, body) => {
if (!error && body && response.statusCode == 200) try {
grabbedThemes = BDFDB.ArrayUtils.keySort(JSON.parse(body).filter(n => n), "name");
@ -1001,7 +1001,7 @@ module.exports = (_ => {
catch (err) {BDFDB.NotificationUtils.toast("Failed to load Theme Store", {type: "danger"});}
if (response && response.statusCode == 403) BDFDB.NotificationUtils.toast("Failed to fetch Theme Store from the Website Api due to DDoS Protection", {type: "danger"});
else if (response && response.statusCode == 404) BDFDB.NotificationUtils.toast("Failed to fetch Theme Store from the Website Api due to Connection Issue", {type: "danger"});
});
}), 10000);
}
getLoadingTooltipText () {