mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +08:00
🐛 Fix(custom): fix theme update func
This commit is contained in:
@@ -1862,7 +1862,7 @@ import {
|
||||
import { marked } from 'marked'
|
||||
import type { IConfig } from 'piclist'
|
||||
import pkg from 'root/package.json'
|
||||
import { computed, onBeforeMount, reactive, ref, toRaw, watch } from 'vue'
|
||||
import { computed, onBeforeMount, onBeforeUnmount, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -2190,6 +2190,19 @@ onBeforeMount(() => {
|
||||
initData()
|
||||
})
|
||||
|
||||
let unbindTheme: () => void
|
||||
onMounted(() => {
|
||||
unbindTheme = window.electron.onThemeUpdate((_: string) => {
|
||||
console.log('Applying theme CSS update:')
|
||||
})
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (unbindTheme) {
|
||||
unbindTheme()
|
||||
}
|
||||
})
|
||||
|
||||
async function loadThemes() {
|
||||
try {
|
||||
const themes = await window.electron.triggerRPC<{ key: string; label: string }[]>(
|
||||
|
||||
Reference in New Issue
Block a user