0.14: Reduce memory usage when running app settings page

master
Gordon Williams 2020-04-14 16:11:29 +01:00
parent 22a005203f
commit d54c0c7dea
3 changed files with 5 additions and 6 deletions

View File

@ -119,7 +119,7 @@
{ "id": "setting",
"name": "Settings",
"icon": "settings.png",
"version":"0.13",
"version":"0.14",
"description": "A menu for setting up Bangle.js",
"tags": "tool,system",
"storage": [

View File

@ -14,4 +14,5 @@
Move LCD Timeout to wakeup menu
0.13: Fix memory leak for App settings
Make capitalization more consistent
Move LCD Brightness menu into more general LCD menu
Move LCD Brightness menu into more general LCD menu
0.14: Reduce memory usage when running app settings page

View File

@ -325,8 +325,6 @@ function showClockMenu() {
return E.showMenu(clockMenu);
}
function showSetTimeMenu() {
d = new Date();
const timemenu = {
@ -419,8 +417,8 @@ function showAppSettingsMenu() {
'< Back': ()=>showMainMenu(),
}
const apps = storage.list(/\.info$/)
.map(app => storage.readJSON(app, 1))
.filter(app => app && app.settings)
.map(app => {var a=storage.readJSON(app, 1);return (a&&a.settings)?a:undefined})
.filter(app => app) // filter out any undefined apps
.sort((a, b) => a.sortorder - b.sortorder)
if (apps.length === 0) {
appmenu['No app has settings'] = () => { };