Fix navigator undefined error
This commit is contained in:
parent
872f1b38ae
commit
154c50c67b
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
||||||
import {Separator} from "$lib/components/ui/separator";
|
import {Separator} from "$lib/components/ui/separator";
|
||||||
import {onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
|
|
||||||
let locale = $state(navigator.language);
|
let locale = $state("en-GB");
|
||||||
let mounted = $state(false);
|
let mounted = $state(false);
|
||||||
|
|
||||||
let thrusters: Array<Thruster> = $state([])
|
let thrusters: Array<Thruster> = $state([])
|
||||||
|
@ -155,6 +155,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
if (navigator) {
|
||||||
|
locale = navigator.language;
|
||||||
|
}
|
||||||
let localThrusters = localStorage.getItem("thrusters");
|
let localThrusters = localStorage.getItem("thrusters");
|
||||||
if (typeof localThrusters !== "undefined" && localThrusters !== "") {
|
if (typeof localThrusters !== "undefined" && localThrusters !== "") {
|
||||||
thrusters = JSON.parse(localThrusters);
|
thrusters = JSON.parse(localThrusters);
|
||||||
|
|
Loading…
Reference in a new issue