Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Dec 27, 2023
1 parent eaccfd3 commit d02075f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
this.theme = mode.computed
this.systemTheme = mode.theme
})
const onChangeCallback = (theme) => {
const onThemeChange = (theme) => {
this.theme = theme
if (theme === "system") {
document.body.setAttribute("theme", window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
} else {
document.body.setAttribute("theme", theme)
}
}
onChangeCallback(window.heynote.themeMode.initial)
window.heynote.themeMode.onChange(onChangeCallback)
onThemeChange(window.heynote.themeMode.initial)
window.heynote.themeMode.onChange(onThemeChange)
window.heynote.onSettingsChange((settings) => {
this.settings = settings
})
Expand Down

0 comments on commit d02075f

Please sign in to comment.