keep analysis result
This commit is contained in:
28
src/stores/analysis.ts
Normal file
28
src/stores/analysis.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// filepath: src/stores/analysis.ts
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useAnalysisStore = defineStore('analysis', () => {
|
||||
const url = ref('')
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const metadata = ref<any>(null)
|
||||
|
||||
const options = ref({
|
||||
is_audio_only: false,
|
||||
quality: 'best',
|
||||
output_path: ''
|
||||
})
|
||||
|
||||
function reset() {
|
||||
url.value = ''
|
||||
loading.value = false
|
||||
error.value = ''
|
||||
metadata.value = null
|
||||
// We keep options as is, or reset them?
|
||||
// Usually keeping user preference for "Audio Only" is nice,
|
||||
// but let's just reset the content-related stuff.
|
||||
}
|
||||
|
||||
return { url, loading, error, metadata, options, reset }
|
||||
})
|
||||
Reference in New Issue
Block a user