mirror of https://github.com/espruino/BangleApps
chargerot: handle missing settings (e.g. first install)
parent
ba995ddf4e
commit
c5cf741df1
|
@ -1 +1,2 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
|
0.02: Handle missing settings (e.g. first-install)
|
||||||
|
|
|
@ -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;
|
const defaultRotation = 0 | require('Storage').readJSON("setting.json").rotate;
|
||||||
if (Bangle.isCharging()) g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
|
if (Bangle.isCharging()) g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
|
||||||
Bangle.on('charging', (charging) => {
|
Bangle.on('charging', (charging) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "chargerot",
|
"id": "chargerot",
|
||||||
"name": "Charge LCD rotation",
|
"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.",
|
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"tags": "battery",
|
"tags": "battery",
|
||||||
|
|
Loading…
Reference in New Issue