Fix morescreen (which shows the custom themes now), remove invalid themes automatically

This commit is contained in:
Pieter Vander Vennet 2020-10-18 00:28:51 +02:00
parent f771695c0b
commit 1e0a1fdf97
5 changed files with 31 additions and 11 deletions

View file

@ -41,7 +41,19 @@ export class OsmPreferences {
const self = this;
source.addCallback(str => {
if (str === undefined || str === "") {
return
return;
}
if(str === null){
console.error("Deleting "+allStartWith);
let count = parseInt(length.data);
for (let i = 0; i < count; i++) {
// Delete all the preferences
self.GetPreference(allStartWith + "-" + i, "")
.setData("");
}
self.GetPreference(allStartWith + "-length", "")
.setData("");
return
}
let i = 0;
@ -75,7 +87,6 @@ export class OsmPreferences {
}
source.setData(str);
console.log("Long preference", key, "has", str.length, "chars");
}
length.addCallback(l => {