unicorn/no-lonely-if

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper
2021-01-02 20:23:52 -08:00
parent e763993574
commit 2976254bbc
3 changed files with 6 additions and 6 deletions

View File

@@ -106,10 +106,11 @@ function updateQueriesOverTime() {
}
for (hour in data.ads_over_time[0]) {
if (Object.prototype.hasOwnProperty.call(data.ads_over_time[0], hour)) {
if (dates.indexOf(parseInt(data.ads_over_time[0][hour], 10)) === -1) {
dates.push(parseInt(data.ads_over_time[0][hour], 10));
}
if (
Object.prototype.hasOwnProperty.call(data.ads_over_time[0], hour) &&
dates.indexOf(parseInt(data.ads_over_time[0][hour], 10)) === -1
) {
dates.push(parseInt(data.ads_over_time[0][hour], 10));
}
}