Skip to content

Commit b204f96

Browse files
committed
tidy code
1 parent 18915cc commit b204f96

File tree

5 files changed

+163
-936
lines changed

5 files changed

+163
-936
lines changed

worldmap.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ module.exports = function(RED) {
201201
if (msg.payload.ttl && msg.payload.ttl < t) { t = msg.payload.ttl; }
202202
allPoints[msg.payload.name].tout = setTimeout( function() { delete allPoints[msg.payload.name] }, t * 1000 );
203203
}
204-
if (msg?.payload?.command?.map?.delete) {
204+
if (msg.payload?.command?.map?.delete) {
205205
var ddd = msg.payload.command.map.delete;
206206
if (!Array.isArray(ddd)) { ddd = [cmd.map.delete]; }
207207
for (let a=0; a < ddd.length; a++) {
@@ -227,7 +227,8 @@ module.exports = function(RED) {
227227
for (var i=0; i < RED.httpNode._router.stack.length; i++) {
228228
var r = RED.httpNode._router.stack[i];
229229
if ((r.name === "serveStatic") && (r.regexp.test(node.path))) {
230-
RED.httpNode._router.stack.splice(i, 1)
230+
RED.httpNode._router.stack.splice(i, 1);
231+
i = i-1;
231232
}
232233
}
233234
node.status({});
@@ -479,7 +480,7 @@ module.exports = function(RED) {
479480
node.send(newmsg); // send the track
480481
}
481482
}
482-
if (msg?.payload?.command?.map?.delete) {
483+
if (msg.payload?.command?.map?.delete) {
483484
var ddd = msg.payload.command.map.delete;
484485
if (!Array.isArray(ddd)) { ddd = [cmd.map.delete]; }
485486
for (let a=0; a < ddd.length; a++) {
@@ -492,8 +493,8 @@ module.exports = function(RED) {
492493
}
493494
}
494495
}
495-
if (msg?.payload?.command?.clear) {
496-
if (!isArray(msg?.payload?.command?.clear)) {
496+
if (msg.payload?.command?.clear) {
497+
if (!isArray(msg.payload?.command?.clear)) {
497498
msg.payload.command.clear = [ msg.payload.command.clear ]
498499
}
499500
msg.payload.command.clear.forEach(function(el) {
@@ -506,8 +507,8 @@ module.exports = function(RED) {
506507
}
507508
})
508509
}
509-
if (msg?.payload?.command?.clearlayer) {
510-
if (!isArray(msg?.payload?.command?.clearlayer)) {
510+
if (msg.payload?.command?.clearlayer) {
511+
if (!isArray(msg.payload?.command?.clearlayer)) {
511512
msg.payload.command.clearlayer = [ msg.payload.command.clearlayer ]
512513
}
513514
msg.payload.command.clearlayer.forEach(function(el) {

worldmap/leaflet/dialog-polyfill.css

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)