add quickjs but has bugs
This commit is contained in:
@@ -17,6 +17,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
})
|
||||
|
||||
const ytdlpVersion = ref('Checking...')
|
||||
const quickjsVersion = ref('Checking...')
|
||||
const isInitializing = ref(true)
|
||||
|
||||
async function loadSettings() {
|
||||
@@ -43,15 +44,21 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
isInitializing.value = true
|
||||
// check/download
|
||||
await invoke('init_ytdlp')
|
||||
ytdlpVersion.value = await invoke('get_ytdlp_version')
|
||||
await refreshVersions()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
ytdlpVersion.value = 'Error'
|
||||
quickjsVersion.value = 'Error'
|
||||
} finally {
|
||||
isInitializing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshVersions() {
|
||||
ytdlpVersion.value = await invoke('get_ytdlp_version')
|
||||
quickjsVersion.value = await invoke('get_quickjs_version')
|
||||
}
|
||||
|
||||
function applyTheme(theme: string) {
|
||||
const root = document.documentElement
|
||||
const isDark = theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
@@ -69,5 +76,5 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
}
|
||||
})
|
||||
|
||||
return { settings, loadSettings, save, initYtdlp, ytdlpVersion, isInitializing }
|
||||
})
|
||||
return { settings, loadSettings, save, initYtdlp, refreshVersions, ytdlpVersion, quickjsVersion, isInitializing }
|
||||
})
|
||||
Reference in New Issue
Block a user