From c6ce382188b3e12a37907bd77ae1380d9644e2c8 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 7 Jan 2022 15:12:06 +0000 Subject: [PATCH] fix: zero-padded time, custom background settings ui --- src/components/widgets/background/Background.jsx | 11 +++++++---- src/modules/default_settings.json | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx index efb147a4..196df370 100644 --- a/src/components/widgets/background/Background.jsx +++ b/src/components/widgets/background/Background.jsx @@ -182,12 +182,15 @@ export default class Background extends PureComponent { break; case 'custom': - let customBackground; + let customBackground = []; + const customSaved = localStorage.getItem('customBackground'); try { - customBackground = JSON.parse(localStorage.getItem('customBackground')); + customBackground = JSON.parse(customSaved); } catch (e) { - // move to new format - customBackground = [localStorage.getItem('customBackground')]; + if (customSaved !== '') { + // move to new format + customBackground = [customSaved]; + } localStorage.setItem('customBackground', JSON.stringify(customBackground)); } diff --git a/src/modules/default_settings.json b/src/modules/default_settings.json index d08a5f06..33febce9 100644 --- a/src/modules/default_settings.json +++ b/src/modules/default_settings.json @@ -27,6 +27,10 @@ "name": "brightness", "value": 90 }, + { + "name": "zero", + "value": true + }, { "name": "events", "value": true