espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
496 stars 1.17k forks source link

alarm: fix uncaught error if no scroller (Bangle 1) #3605

Closed thyttan closed 1 month ago

thyttan commented 1 month ago

This PR seems to fix the following. Tested in the Bangle.js 1 emulator on the Web IDE.

Just tried on emulated Bangle.js 1 and got:

Uncaught Error: Can't read property 'scroll' of undefined
 at line 20 col 1070 in alarm.app.js
...mMenu,10,e,index,undefined,scroller.scroll,group)
                                      ^
in function "onchange" called from line 3 col 106
...onchange)a.onchange(a.value);Bangle.touchHandler==u&&d.draw(...
                              ^
in function "select" called from line 1 col 22
a?d.move(a):d.select()
                     ^
in function "d" called from line 1 col 3
d()
  ^
in function called from system
> 

Looking at the git blame it seems to have been around since 2023-11-14.

Originally posted by @thyttan in https://github.com/espruino/BangleApps/issues/3604#issuecomment-2397608781

gfwilliams commented 1 month ago

Thanks! Good spot - yes, we don't use a scroller on Bangle.js1 because we can't scroll just part of the screen