Skip to content

Commit 4f44e97

Browse files
committed
Reduce redundant console logging code (compiled)
1 parent 1e18737 commit 4f44e97

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

extension/dst/chestManagement.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ function refreshInventory(userId, hash) {
424424
switch (_e.label) {
425425
case 0:
426426
if (!userId || userId.length == 0 || !hash || hash.length == 0) {
427-
console.error("No credentials entered.");
428427
showError("No credentials entered.");
429428
return [2];
430429
}
@@ -437,7 +436,6 @@ function refreshInventory(userId, hash) {
437436
case 2:
438437
if (!_server) {
439438
showError("Failed to get idle champions server.");
440-
console.error("Failed to get idle champions server.");
441439
return [2];
442440
}
443441
return [4, IdleChampionsApi.getUserDetails({
@@ -449,7 +447,6 @@ function refreshInventory(userId, hash) {
449447
_userData = _e.sent();
450448
if (!_userData) {
451449
showError("Failed to retreive user data.");
452-
console.error("Failed to retreive user data.");
453450
return [2];
454451
}
455452
console.log("Refreshed inventory data.");
@@ -562,12 +559,10 @@ function purchaseChests(userId, hash) {
562559
console.log("Switching server");
563560
}
564561
if (responseStatus.status == ResponseStatus.InsuficcientCurrency) {
565-
console.error("Insufficient currency error");
566562
showError("Insufficient gems remaining");
567563
return [2];
568564
}
569565
else if (responseStatus.status == ResponseStatus.Failed) {
570-
console.error("Purchase API call failed");
571566
showError("Purchase failed");
572567
return [2];
573568
}
@@ -654,15 +649,13 @@ function openChests(userId, hash) {
654649
case 3:
655650
_a.sent();
656651
if (_instanceId == lastInstanceId) {
657-
console.error("Failed to refresh instance id");
658652
showError("Failed to get updated instance ID. Check credentials.");
659653
return [2];
660654
}
661655
remainingChests += currentAmount;
662656
return [3, 5];
663657
case 4:
664658
if (openResponse.status == ResponseStatus.Failed) {
665-
console.error("Purchase API call failed");
666659
showError("Purchase failed");
667660
return [2];
668661
}
@@ -696,6 +689,7 @@ function hideMessages() {
696689
document.getElementById("info").classList.remove("show");
697690
}
698691
function showError(text) {
692+
console.error(text);
699693
hideMessages();
700694
document.getElementById("error").classList.add("show");
701695
document.querySelector("#error span").innerHTML = text;
@@ -838,15 +832,13 @@ function useBlacksmithContracts(userId, hash) {
838832
case 3:
839833
_a.sent();
840834
if (_instanceId == lastInstanceId) {
841-
console.error("Failed to refresh instance id");
842835
showError("Failed to get updated instance ID. Check credentials.");
843836
return [2];
844837
}
845838
remainingContracts += currentAmount;
846839
return [3, 5];
847840
case 4:
848841
if (blacksmithResponse.status == ResponseStatus.Failed) {
849-
console.error("Blacksmith API call failed");
850842
showError("Blacksmithing failed");
851843
return [2];
852844
}

0 commit comments

Comments
 (0)