Skip to content

settings: handle a undefined scroller (BJS1) #3828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/setting/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ of 'Select Clock'
0.75: Restore previous menu's scroll positions
0.76: Add altitude calibration menu (and update README after menu changed)
0.77: Save altitude calibration when user exits via reset
0.78: Fix menu scroll restore on BangleJS1
2 changes: 1 addition & 1 deletion apps/setting/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "setting",
"name": "Settings",
"version": "0.77",
"version": "0.78",
"description": "A menu for setting up Bangle.js",
"icon": "settings.png",
"tags": "tool,system",
Expand Down
3 changes: 2 additions & 1 deletion apps/setting/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function pushMenu(menu) {
function restoreMenu(menu) {
// equivalent to pushMenu(null); popMenu(menu);
if(!menu[""]) menu[""] = {};
menu[""].scroll = menuScroller.scroll;
if(menuScroller) // may be undefined on BangleJS1
menu[""].scroll = menuScroller.scroll;
menuScroller = E.showMenu(menu).scroller;
}

Expand Down