chargerot: handle missing settings (e.g. first install)

pull/2949/head
Rob Pilling 2023-08-03 18:11:45 +01:00
parent ba995ddf4e
commit c5cf741df1
3 changed files with 3 additions and 2 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Handle missing settings (e.g. first-install)

View File

@ -1,5 +1,5 @@
(() => {
const chargingRotation = 0 | require('Storage').readJSON("chargerot.settings.json").rotate;
const chargingRotation = 0 | (require('Storage').readJSON("chargerot.settings.json",1)||{}).rotate;
const defaultRotation = 0 | require('Storage').readJSON("setting.json").rotate;
if (Bangle.isCharging()) g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
Bangle.on('charging', (charging) => {

View File

@ -1,7 +1,7 @@
{
"id": "chargerot",
"name": "Charge LCD rotation",
"version": "0.01",
"version": "0.02",
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
"icon": "icon.png",
"tags": "battery",