Skip to content

Commit

Permalink
messagegui: fix lint warn and some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Jan 4, 2025
1 parent 698f223 commit 8cde05f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/messagegui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,9 @@ function showMessagesScroller(msg, persist, alreadyProcessed) {
const BTN_WATCH = setWatch(()=>{
Bangle.emit("drag", {dy:0}); // Compatibility with `kineticscroll`, stopping the scroller so it doesn't continue scrolling when the `showMessage` screen is loaded.
// Zero ms timeout as to not move on before the scroller has registered the emitted drag event.
setTimeout(()=>{const SCROLL_IDX_CENTER_SCREEN = prevScrollIdx>prevPrevScrollIdx ?
prevScrollIdx-LINES_PER_SCREEN/2 : prevScrollIdx+LINES_PER_SCREEN;
setTimeout(()=>{
const SCROLL_IDX_CENTER_SCREEN = prevScrollIdxs[0]>prevScrollIdxs[1] ?
prevScrollIdxs[0]-LINES_PER_SCREEN/2:prevScrollIdxs[0]+LINES_PER_SCREEN/2;
WU.show();
showMessage(identifyDisplayedMsg(SCROLL_IDX_CENTER_SCREEN).id, true);
},0)
Expand Down

0 comments on commit 8cde05f

Please sign in to comment.