From 4ecb55d23c20735ac5318362a60c5e865d5ec2e9 Mon Sep 17 00:00:00 2001 From: Flaparoo <629229+flaparoo@users.noreply.github.com> Date: Sun, 11 Feb 2024 09:34:13 +0800 Subject: [PATCH] flightdash: put switch case with local var in a codeblocK --- apps/flightdash/flightdash.settings.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/flightdash/flightdash.settings.js b/apps/flightdash/flightdash.settings.js index 7f7081738..6d7de1287 100644 --- a/apps/flightdash/flightdash.settings.js +++ b/apps/flightdash/flightdash.settings.js @@ -60,17 +60,19 @@ loadNearest(fix.lat, fix.lon); break; case 'createUserWaypoint': - if (!('userWaypoints' in settings)) - settings.userWaypoints = []; - let newIdx = settings.userWaypoints.length; - settings.userWaypoints[newIdx] = { - 'ID': 'USER'+(newIdx + 1), - 'lat': fix.lat, - 'lon': fix.lon, - }; - writeSettings(); - showUserWaypoints(); - break; + { + if (!('userWaypoints' in settings)) + settings.userWaypoints = []; + let newIdx = settings.userWaypoints.length; + settings.userWaypoints[newIdx] = { + 'ID': 'USER'+(newIdx + 1), + 'lat': fix.lat, + 'lon': fix.lon, + }; + writeSettings(); + showUserWaypoints(); + break; + } case 'destAVWX': // the free ("hobby") account of AVWX is limited to 10 nearest stations avwx.request('station/near/'+fix.lat+','+fix.lon, 'n=10&airport=true&reporting=false', data => {