Skip to content

Commit

Permalink
messagegui: small refactor of swipeHandler
Browse files Browse the repository at this point in the history
`if (ud!=0)` -> `if (ud>0) ... if (ud<0)`
  • Loading branch information
thyttan committed Feb 28, 2024
1 parent eca0e18 commit 3976afb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/messagegui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ function showMessage(msgid) {
Bangle.swipeHandler = (lr,ud) => {
if (lr>0 && posHandler) posHandler();
if (lr<0 && negHandler) negHandler();
if (ud!=0) {if ((ud<0&&idx>0) || (ud>0&&idx<MESSAGES.length-1)) showMessage(MESSAGES[idx+ud].id);}
if (ud>0 && idx<MESSAGES.length-1) showMessage(MESSAGES[idx+1].id);
if (ud<0 && idx>0) showMessage(MESSAGES[idx-1].id);
};
Bangle.on("swipe", Bangle.swipeHandler);
g.reset().clearRect(Bangle.appRect);
Expand Down

0 comments on commit 3976afb

Please sign in to comment.