mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Fix some eslint errors from previous merges
This commit is contained in:
@@ -135,7 +135,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
} else if (notification === "FETCH_ERROR") {
|
} else if (notification === "FETCH_ERROR") {
|
||||||
Log.error("Calendar Error. Could not fetch calendar: " + payload.url);
|
Log.error("Calendar Error. Could not fetch calendar: " + payload.url);
|
||||||
this.loaded = true
|
this.loaded = true;
|
||||||
} else if (notification === "INCORRECT_URL") {
|
} else if (notification === "INCORRECT_URL") {
|
||||||
Log.error("Calendar Error. Incorrect url: " + payload.url);
|
Log.error("Calendar Error. Incorrect url: " + payload.url);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -171,8 +171,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
var geo = event.geo || false;
|
var geo = event.geo || false;
|
||||||
var description = event.description || false;
|
var description = event.description || false;
|
||||||
|
|
||||||
|
if (typeof event.rrule !== "undefined" && event.rrule !== null && !isFacebookBirthday) {
|
||||||
if (typeof event.rrule !== 'undefined' && event.rrule !== null && !isFacebookBirthday) {
|
|
||||||
var rule = event.rrule;
|
var rule = event.rrule;
|
||||||
var addedEvents = 0;
|
var addedEvents = 0;
|
||||||
|
|
||||||
@@ -210,7 +209,6 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Loop through the set of date entries to see which recurrences should be added to our event list.
|
// Loop through the set of date entries to see which recurrences should be added to our event list.
|
||||||
for (var d in dates) {
|
for (var d in dates) {
|
||||||
var date = dates[d];
|
var date = dates[d];
|
||||||
@@ -246,7 +244,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
|
|
||||||
endDate = moment(parseInt(startDate.format("x")) + duration, "x");
|
endDate = moment(parseInt(startDate.format("x")) + duration, "x");
|
||||||
if (startDate.format("x") == endDate.format("x")) {
|
if (startDate.format("x") == endDate.format("x")) {
|
||||||
endDate = endDate.endOf("day")
|
endDate = endDate.endOf("day");
|
||||||
}
|
}
|
||||||
|
|
||||||
var recurrenceTitle = getTitleFromEvent(curEvent);
|
var recurrenceTitle = getTitleFromEvent(curEvent);
|
||||||
|
@@ -60,7 +60,7 @@ module.exports = NodeHelper.create({
|
|||||||
});
|
});
|
||||||
|
|
||||||
fetcher.onError(function(fetcher, error) {
|
fetcher.onError(function(fetcher, error) {
|
||||||
console.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error)
|
console.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error);
|
||||||
self.sendSocketNotification("FETCH_ERROR", {
|
self.sendSocketNotification("FETCH_ERROR", {
|
||||||
url: fetcher.url(),
|
url: fetcher.url(),
|
||||||
error: error
|
error: error
|
||||||
|
@@ -273,13 +273,13 @@ Module.register("newsfeed",{
|
|||||||
newsItems.forEach(value => {
|
newsItems.forEach(value => {
|
||||||
if (this.newsItems.findIndex(value1 => value1 === value) === -1) {
|
if (this.newsItems.findIndex(value1 => value1 === value) === -1) {
|
||||||
// Add item to updated items list
|
// Add item to updated items list
|
||||||
updatedItems.push(value)
|
updatedItems.push(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// check if updated items exist, if so and if we should broadcast these updates, then lets do so
|
// check if updated items exist, if so and if we should broadcast these updates, then lets do so
|
||||||
if (this.config.broadcastNewsUpdates && updatedItems.length > 0) {
|
if (this.config.broadcastNewsUpdates && updatedItems.length > 0) {
|
||||||
this.sendNotification("NEWS_FEED_UPDATE", {items: updatedItems})
|
this.sendNotification("NEWS_FEED_UPDATE", {items: updatedItems});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.newsItems = newsItems;
|
this.newsItems = newsItems;
|
||||||
|
@@ -211,7 +211,7 @@ Module.register("weather",{
|
|||||||
value = "";
|
value = "";
|
||||||
} else {
|
} else {
|
||||||
if (this.config.weatherProvider === "ukmetoffice") {
|
if (this.config.weatherProvider === "ukmetoffice") {
|
||||||
value += "%"
|
value += "%";
|
||||||
} else {
|
} else {
|
||||||
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;
|
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ class WeatherObject {
|
|||||||
|
|
||||||
feelsLike() {
|
feelsLike() {
|
||||||
if (this.feelsLikeTemp) {
|
if (this.feelsLikeTemp) {
|
||||||
return this.feelsLikeTemp
|
return this.feelsLikeTemp;
|
||||||
}
|
}
|
||||||
const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694;
|
const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694;
|
||||||
const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32;
|
const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32;
|
||||||
|
Reference in New Issue
Block a user