Skip to content

Commit 8cde05f

Browse files
author
thyttan
committed
messagegui: fix lint warn and some logic
1 parent 698f223 commit 8cde05f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/messagegui/app.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ function showMessagesScroller(msg, persist, alreadyProcessed) {
407407
const BTN_WATCH = setWatch(()=>{
408408
Bangle.emit("drag", {dy:0}); // Compatibility with `kineticscroll`, stopping the scroller so it doesn't continue scrolling when the `showMessage` screen is loaded.
409409
// Zero ms timeout as to not move on before the scroller has registered the emitted drag event.
410-
setTimeout(()=>{const SCROLL_IDX_CENTER_SCREEN = prevScrollIdx>prevPrevScrollIdx ?
411-
prevScrollIdx-LINES_PER_SCREEN/2 : prevScrollIdx+LINES_PER_SCREEN;
410+
setTimeout(()=>{
411+
const SCROLL_IDX_CENTER_SCREEN = prevScrollIdxs[0]>prevScrollIdxs[1] ?
412+
prevScrollIdxs[0]-LINES_PER_SCREEN/2:prevScrollIdxs[0]+LINES_PER_SCREEN/2;
412413
WU.show();
413414
showMessage(identifyDisplayedMsg(SCROLL_IDX_CENTER_SCREEN).id, true);
414415
},0)

0 commit comments

Comments
 (0)