op2
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { ref } from 'vue'
|
||||
import type { RuntimeStatus } from '../types/task'
|
||||
|
||||
export interface Settings {
|
||||
download_path: string
|
||||
@@ -21,6 +22,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
const ytdlpVersion = ref('Checking...')
|
||||
const quickjsVersion = ref('Checking...')
|
||||
const ffmpegVersion = ref('Checking...')
|
||||
const runtimeStatus = ref<RuntimeStatus | null>(null)
|
||||
const isInitializing = ref(true)
|
||||
const hasInitialized = ref(false)
|
||||
let mediaQuery: MediaQueryList | null = null
|
||||
@@ -64,15 +66,17 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
}
|
||||
|
||||
async function refreshVersions() {
|
||||
const [ytdlp, quickjs, ffmpeg] = await Promise.allSettled([
|
||||
const [ytdlp, quickjs, ffmpeg, runtime] = await Promise.allSettled([
|
||||
invoke<string>('get_ytdlp_version'),
|
||||
invoke<string>('get_quickjs_version'),
|
||||
invoke<string>('get_ffmpeg_version')
|
||||
invoke<string>('get_ffmpeg_version'),
|
||||
invoke<RuntimeStatus>('get_runtime_status')
|
||||
])
|
||||
|
||||
ytdlpVersion.value = ytdlp.status === 'fulfilled' ? ytdlp.value : 'Error'
|
||||
quickjsVersion.value = quickjs.status === 'fulfilled' ? quickjs.value : 'Error'
|
||||
ffmpegVersion.value = ffmpeg.status === 'fulfilled' ? ffmpeg.value : 'Error'
|
||||
runtimeStatus.value = runtime.status === 'fulfilled' ? runtime.value : null
|
||||
}
|
||||
|
||||
function applyTheme(theme: string) {
|
||||
@@ -115,6 +119,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
ytdlpVersion,
|
||||
quickjsVersion,
|
||||
ffmpegVersion,
|
||||
runtimeStatus,
|
||||
isInitializing
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user