Skip to content

Commit 3499392

Browse files
Actually show an error when the revive request fails instead of showing the success message.
1 parent fa2ed8d commit 3499392

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

extension/changelog.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"features": [],
88
"fixes": [
99
{ "message": "Correctly count the supply pack value.", "contributor": "DeKleineKobini" },
10-
{ "message": "Avoid an error on the item market when switching categories.", "contributor": "DeKleineKobini" }
10+
{ "message": "Avoid an error on the item market when switching categories.", "contributor": "DeKleineKobini" },
11+
{ "message": "Actually show an error when the revive request fails instead of showing the success message.", "contributor": "DeKleineKobini" }
1112
],
1213
"changes": [{ "message": "Better optimize calls to tornpal.", "contributor": "DeKleineKobini" }],
1314
"removed": []

extension/scripts/global/functions/api-external.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ function doRequestRevive(id, name, country, faction) {
169169
const provider = REVIVE_PROVIDERS.find((p) => p.provider === providerName);
170170
if (!provider) throw new Error(`Revive provider '${providerName}' not found.`);
171171

172-
return provider
173-
.doRequest(id, name, country, faction, source)
174-
.then(({ response, contract }) => ({ response, contract, provider }))
175-
.catch((response) => ({ response, provider }));
172+
return new Promise((resolve, reject) => {
173+
provider
174+
.doRequest(id, name, country, faction, source)
175+
.then(({ response, contract }) => resolve({ response, contract, provider }))
176+
.catch((response) => reject({ response, provider }));
177+
});
176178
}
177179

178180
function calculateRevivePrice({ price }) {

0 commit comments

Comments
 (0)