From c0ea3138e51e0687463a08ca1cd7b1cc3af4b43a Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 21 Apr 2024 19:32:44 +0100 Subject: [PATCH] ha: merge conditionals --- apps/ha/ha.app.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/ha/ha.app.js b/apps/ha/ha.app.js index 14c6dc3be..d63230137 100644 --- a/apps/ha/ha.app.js +++ b/apps/ha/ha.app.js @@ -71,23 +71,20 @@ Bangle.on('touch', function(btn, e){ if(isLeft){ toLeft(); - } - if(isRight){ + }else if (isRight){ toRight(); - } - if(!isRight && !isLeft){ + }else{ sendTrigger(); } }); Bangle.on("swipe", (lr,ud) => { - if (lr == -1) { - toLeft(); - } - if (lr == 1) { - toRight(); - } - }); + if (lr == -1) { + toLeft(); + } else if (lr == 1) { + toRight(); + } +}); // Send intent that the we started the app.