🩹 Fixes all minor issues raised by DeepScan

This commit is contained in:
Alicia Sykes 2021-12-26 23:14:25 +00:00
parent 970b417f44
commit 1324b43c0e
8 changed files with 8 additions and 8 deletions

View File

@ -85,7 +85,7 @@ export default {
axios.get(this.endpoint)
.then((response) => {
try {
this.lineStatuses = this.processData(response.data);
this.processData(response.data);
} catch (chartingError) {
this.error('Unable to plot results on chart', chartingError);
}

View File

@ -47,7 +47,7 @@ export default {
},
limit() {
const userChoice = this.options.limit;
if (userChoice && !Number.isNaN(userChoice) && userChoice > 0) return userChoice;
if (userChoice && userChoice > 0) return userChoice;
return 100;
},
/* How results should be sorted */

View File

@ -83,7 +83,7 @@ export default {
},
limit() {
const usersChoice = this.options.limit;
if (usersChoice && !Number.isNaN(usersChoice)) return usersChoice;
if (usersChoice) return usersChoice;
return 8;
},
/* The starting date, right now, in ISO String format */

View File

@ -40,7 +40,7 @@ export default {
},
monthsToShow() {
const usersChoice = this.options.monthsToShow;
if (usersChoice && !Number.isNaN(usersChoice) && usersChoice > 0 && usersChoice <= 24) {
if (usersChoice && usersChoice > 0 && usersChoice <= 24) {
return usersChoice;
}
return 12;

View File

@ -53,7 +53,7 @@ export default {
},
limit() {
const usersChoice = this.options.limit;
if (usersChoice && !Number.isNaN(usersChoice)) return usersChoice;
if (usersChoice) return usersChoice;
return 10;
},
orderBy() {

View File

@ -142,7 +142,7 @@ export default {
},
/* Format the price, rounding to given number of decimal places */
formatPrice(priceStr) {
const price = parseInt(priceStr, 10);
const price = parseFloat(priceStr, 10);
let numDecimals = 0;
if (price < 10) numDecimals = 1;
if (price < 1) numDecimals = 2;

View File

@ -40,7 +40,7 @@ export default {
return username ? `${username}@` : '';
},
makeUptime(seconds) {
if (!seconds || seconds === 0) return '';
if (!seconds) return '';
if (seconds < 60) return `${seconds} seconds`;
if (seconds < 3600) return `${(seconds / 60).toFixed(1)} minutes`;
if (seconds < 86400) return `${(seconds / 3600).toFixed(2)} hours`;

View File

@ -31,7 +31,7 @@ export default {
return 'latest';
} else if (usersChoice === 'random') {
return Math.abs(Math.floor(Math.random() * (1 - 2553)));
} else if (!Number.isNaN(usersChoice)) {
} else if (usersChoice) {
return usersChoice;
}
return 'latest';