Skip to content

Commit

Permalink
remove semicolon after 'if' statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadzurami committed Aug 12, 2024
1 parent 1dcd7d0 commit 5287b07
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
if (url.startsWith('https://steamcommunity.com/market/')) {
requestStorageHash = `${requestStorageHash}:steamcommunity.com/market`;
delayBetweenRequests = 1000;
};
}

const lastRequest = JSON.parse(getLocalStorageItem(requestStorageHash) || JSON.stringify({ time: new Date(0), limited: false }));
const timeSinceLastRequest = Date.now() - new Date(lastRequest.time).getTime();
Expand All @@ -126,7 +126,7 @@
if (timeSinceLastRequest < delayBetweenRequests) {
setTimeout(() => request(...arguments), delayBetweenRequests - timeSinceLastRequest);
return;
};
}

lastRequest.time = new Date();
lastRequest.limited = false;
Expand All @@ -141,7 +141,7 @@
if (xhr.status === 429) {
lastRequest.limited = true;
setLocalStorageItem(requestStorageHash, JSON.stringify(lastRequest));
};
}

if (xhr.status >= 400) {
const error = new Error('Http error');
Expand All @@ -156,7 +156,7 @@
if (xhr.status === 429) {
lastRequest.limited = true;
setLocalStorageItem(requestStorageHash, JSON.stringify(lastRequest));
};
}

const error = new Error('Request failed');
error.statusCode = xhr.status;
Expand Down Expand Up @@ -540,7 +540,7 @@
if (error) {
callback(ERROR_FAILED);
return;
};
}

callback(ERROR_SUCCESS, data);
}
Expand Down Expand Up @@ -624,7 +624,7 @@
if (error) {
callback(ERROR_FAILED, data);
return;
};
}

callback(ERROR_SUCCESS, data);
}
Expand Down Expand Up @@ -666,7 +666,7 @@
if (error) {
callback(ERROR_FAILED, data);
return;
};
}

callback(ERROR_SUCCESS, data);
}
Expand Down Expand Up @@ -706,7 +706,7 @@
if (error) {
callback(ERROR_FAILED, data);
return;
};
}

callback(ERROR_SUCCESS, data);
}
Expand Down Expand Up @@ -741,12 +741,12 @@
if (error) {
callback(ERROR_FAILED);
return;
};
}

if (data && (!data.success || !data.prices)) {
callback(ERROR_DATA);
return;
};
}

// Multiply prices so they're in pennies.
for (let i = 0; i < data.prices.length; i++) {
Expand Down Expand Up @@ -806,7 +806,7 @@
if (error) {
callback(ERROR_FAILED);
return;
};
}

const matches = (/Market_LoadOrderSpread\( (\d+) \);/).exec(data || '');
if (matches == null) {
Expand Down Expand Up @@ -883,7 +883,7 @@
if (error) {
callback(ERROR_FAILED);
return;
};
}

const url = `${window.location.origin}/market/itemordershistogram`;

Expand All @@ -905,7 +905,7 @@
if (error) {
callback(ERROR_FAILED, null);
return;
};
}

// Store the histogram in the session storage.
const storage_hash = `itemordershistogram_${item.appid}+${market_name}`;
Expand Down Expand Up @@ -1316,7 +1316,7 @@
callback()

return;
};
}

if (message && isRetryMessage(message)) {
logDOM(`${padLeft} - ${itemName} retrying listing because: ${message.charAt(0).toLowerCase()}${message.slice(1)}`);
Expand All @@ -1329,7 +1329,7 @@
callback();

return;
};
}

logDOM(`${padLeft} - ${itemName} not added to market${message ? ` because: ${message.charAt(0).toLowerCase()}${message.slice(1)}` : '.'}`);
$(`#${task.item.appid}_${task.item.contextid}_${itemId}`).css('background', COLOR_ERROR);
Expand Down Expand Up @@ -1812,7 +1812,7 @@
if (!item.ignoreErrors) {
item.ignoreErrors = true;
itemQueue.push(item);
};
}

const delay = numberOfFailedRequests > 1 ? getRandomInt(30000, 45000) : getRandomInt(1000, 1500);
numberOfFailedRequests = numberOfFailedRequests > 3 ? 0 : numberOfFailedRequests;
Expand Down Expand Up @@ -2485,7 +2485,7 @@
if (!item.ignoreErrors) {
item.ignoreErrors = true;
inventoryPriceQueue.push(item);
};
}

numberOfFailedRequests++;

Expand Down Expand Up @@ -2955,7 +2955,7 @@
if (error || !data?.success) {
callback();
return;
};
}

const myMarketListings = $('#tabContentsMyActiveMarketListingsRows');

Expand Down

0 comments on commit 5287b07

Please sign in to comment.