I'm trying to program the settings for an app. All bigger numerical values show up and are selectable without any problems. However the last setting can be selected between Always/Alarms/Never. It shows up nicely in the menu but when I try to select an Item I get a horribly garbled error message in the console and nothig is saved to JSON. However the value in the variable is correctly set. The "Weekend Start Hour" menu works as it is supposed to however the "Follow DND" gives the error.
If I remove writeSettings() from line 31 the menu works as expected but of course it then doesn't save anything when switching apps.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm trying to program the settings for an app. All bigger numerical values show up and are selectable without any problems. However the last setting can be selected between Always/Alarms/Never. It shows up nicely in the menu but when I try to select an Item I get a horribly garbled error message in the console and nothig is saved to JSON. However the value in the variable is correctly set. The "Weekend Start Hour" menu works as it is supposed to however the "Follow DND" gives the error.
If I remove writeSettings() from line 31 the menu works as expected but of course it then doesn't save anything when switching apps.
This is the code in question:
And the error: