mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
Fixes ToggleModeButton.svelte
This commit is contained in:
parent
938be993f5
commit
48bb117276
2 changed files with 10 additions and 10 deletions
|
@ -1,6 +1,5 @@
|
|||
<script>
|
||||
import { query, hasQuery, search } from '~/store'
|
||||
import { onMount } from 'svelte'
|
||||
import SearchFieldMini from './SearchFieldMini.svelte'
|
||||
import Divider from './Divider.svelte'
|
||||
import CreatePlaylistButton from './CreatePlaylistButton.svelte'
|
||||
|
@ -17,15 +16,6 @@
|
|||
hasQuery.set(false)
|
||||
search('')
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
let mode = localStorage.theme || 'light'
|
||||
if (mode === 'dark' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
dark = true
|
||||
} else {
|
||||
dark = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<nav
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import SquareButton from './SquareButton.svelte'
|
||||
|
||||
let dark = false
|
||||
|
@ -14,6 +15,15 @@
|
|||
localStorage.theme = 'dark'
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
let mode = localStorage.theme || 'light'
|
||||
if (mode === 'dark' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
dark = true
|
||||
} else {
|
||||
dark = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<SquareButton on:click={toggleDarkMode} aria-label="Toggle Dark Mode">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue