mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-11 12:32:55 +00:00
feat: periodically update os-layout in the background
fix: remove dead code in layout detection fixes #78 resolves #79
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import "$lib/style/scrollbar.scss"
|
||||
import "$lib/style/tippy.scss"
|
||||
import "$lib/style/theme.scss"
|
||||
import {onMount} from "svelte"
|
||||
import {onDestroy, onMount} from "svelte"
|
||||
import {applyTheme, argbFromHex, themeFromSourceColor} from "@material/material-color-utilities"
|
||||
import Navigation from "./Navigation.svelte"
|
||||
import {canAutoConnect} from "$lib/serial/device"
|
||||
@@ -29,9 +29,10 @@
|
||||
const locale = ((browser && localStorage.getItem("locale")) as Locales) || detectLocale()
|
||||
loadLocale(locale)
|
||||
setLocale(locale)
|
||||
let stopLayoutDetection: () => void
|
||||
|
||||
if (browser) {
|
||||
runLayoutDetection()
|
||||
stopLayoutDetection = runLayoutDetection()
|
||||
tippy.setDefaultProps({
|
||||
animation: "shift-away",
|
||||
theme: "surface-variant",
|
||||
@@ -66,6 +67,10 @@
|
||||
}
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
stopLayoutDetection?.()
|
||||
})
|
||||
|
||||
let webManifestLink = ""
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user