Frontend: Fix fallback to default settings
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
5a8f3f0d85
commit
bfb7d56983
@ -14,6 +14,7 @@
|
||||
- Platform number
|
||||
- Operator
|
||||
- If only one callingPoint, a string is returned instead of an array.
|
||||
* Change dockerfile to deploy with brotli support for faster laoding.
|
||||
|
||||
### In Progress:
|
||||
|
||||
|
@ -7,6 +7,7 @@ async function storageAvailable(type) { // Currently not used
|
||||
let x = '__storage_test__';
|
||||
storage.setItem(x, "test");
|
||||
storage.getItem(x);
|
||||
storage.removeItem(x);
|
||||
log(`lib.main.storageAvailable: ${type} is available`, "INFO")
|
||||
return true;
|
||||
} catch (err) {
|
||||
@ -77,12 +78,17 @@ async function setLoadingDesc(desc) {
|
||||
|
||||
/* Fetch User Settings */
|
||||
async function getQuickLinks() {
|
||||
var defaults =
|
||||
["bri","lwh","srd","mtp","rda","cfn",
|
||||
"sml","shh","pri","avn","sar","svb"];
|
||||
try {
|
||||
var data = JSON.parse(localStorage.getItem("qlOpt"));
|
||||
if (localStorage.getItem("qlOpt")) {
|
||||
var data = JSON.parse(localStorage.getItem("qlOpt"));
|
||||
} else {
|
||||
data = defaults;
|
||||
}
|
||||
} catch (err) {
|
||||
var data =
|
||||
["bri","lwh","srd","mtp","rda","cfn",
|
||||
"sml","shh","pri","avn","sar","svb"];
|
||||
data = defaults;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user