Save settings if killed

master
David Peer 2022-04-15 15:26:57 +02:00
parent 05e390dea2
commit a77990b402
2 changed files with 6 additions and 3 deletions

View File

@ -3,4 +3,4 @@
0.03: Adapt colors based on the theme of the user.
0.04: Steps can be hidden now such that the time is even larger.
0.05: Included icons for information.
0.06: Design improvements.
0.06: Design and usability improvements.

View File

@ -403,7 +403,6 @@ Bangle.on('touch', function(btn, e){
if(is_right){
Bangle.buzz(40, 0.6);
settings.showInfo = (settings.showInfo+1) % maxInfo;
storage.write(SETTINGS_FILE, settings);
draw();
}
@ -411,11 +410,15 @@ Bangle.on('touch', function(btn, e){
Bangle.buzz(40, 0.6);
settings.showInfo = settings.showInfo-1;
settings.showInfo = settings.showInfo < 0 ? maxInfo-1 : settings.showInfo;
storage.write(SETTINGS_FILE, settings);
draw();
}
});
E.on("kill", function(){
storage.write(SETTINGS_FILE, settings);
});
// Show launcher when middle button pressed
Bangle.setUI("clock");