mirror of https://github.com/espruino/BangleApps
fixes json errors in interface.html
Also changed timeout to 1000ms for testingpull/2740/head
parent
96342a3c39
commit
a1a446a4c6
|
@ -259,7 +259,8 @@
|
||||||
|
|
||||||
// Save the provided theme to Bangle.js storage and set Shadow Clock as the default clock
|
// Save the provided theme to Bangle.js storage and set Shadow Clock as the default clock
|
||||||
function saveThemeToSettings(theme) {
|
function saveThemeToSettings(theme) {
|
||||||
Puck.eval('require("Storage").readJSON("setting.json", true)', (data) => {
|
Puck.eval('[require("Storage").readJSON("setting.json", true)]', (dataArray) => {
|
||||||
|
let data = dataArray ? dataArray[0] : null;
|
||||||
if (data) {
|
if (data) {
|
||||||
// Ensure that data.theme exists
|
// Ensure that data.theme exists
|
||||||
if (!data.theme) {
|
if (!data.theme) {
|
||||||
|
@ -277,7 +278,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize Shadow Clock color and theme settings with defaults
|
// Initialize color and theme settings
|
||||||
let selectedColor = "#0ff";
|
let selectedColor = "#0ff";
|
||||||
let isDarkBg = false;
|
let isDarkBg = false;
|
||||||
|
|
||||||
|
@ -285,7 +286,7 @@
|
||||||
function loadSettings(callback) {
|
function loadSettings(callback) {
|
||||||
// Set a timeout for loading the settings
|
// Set a timeout for loading the settings
|
||||||
const timeout = new Promise((_, reject) =>
|
const timeout = new Promise((_, reject) =>
|
||||||
setTimeout(() => reject(new Error("Timeout occurred")), 50)
|
setTimeout(() => reject(new Error("Timeout occurred")), 1000)
|
||||||
);
|
);
|
||||||
// Load settings from Bangle.js storage
|
// Load settings from Bangle.js storage
|
||||||
const loadSettingsFromStorage = new Promise((resolve) => {
|
const loadSettingsFromStorage = new Promise((resolve) => {
|
||||||
|
|
Loading…
Reference in New Issue