Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
kd3n1z committed Jan 24, 2023
1 parent 4ceea1b commit 7754b71
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions www/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const defaultSettings = {
}
};

let settings: any = {...defaultSettings};
let settings: any;

function resetSettings(): void{
settings = {...defaultSettings};
Expand Down Expand Up @@ -345,15 +345,28 @@ function openLink(url: string): void {
}

document.addEventListener("deviceready", () => {
settings = {...defaultSettings};

let loading: HTMLElement = document.getElementById("loading");

setTimeout(() => {
loading.remove();
},1000);


display();

screen.orientation.lock('portrait');

document.getElementById("buildNum").textContent = build.toString();

let s = localStorage.getItem("settings");
if(s != null) {
settings = JSON.parse(s);
let sJson: string = localStorage.getItem("settings");
if(sJson != null) {
let s = JSON.parse(sJson);

Object.keys(s).forEach(element => {
settings[element] = s[element];
});
}

loadSettings();
Expand Down Expand Up @@ -381,11 +394,5 @@ document.addEventListener("deviceready", () => {
}
);

let loading: HTMLElement = document.getElementById("loading");

loading.classList.add("closed"); // start animation

setTimeout(() => {
loading.remove(); // remove the element after animation
},400);
}, false);

0 comments on commit 7754b71

Please sign in to comment.