fix updating max_workers in UI

This commit is contained in:
ArabCoders 2024-12-30 11:03:01 +03:00
parent 448a145ed0
commit 0359eafbec

View file

@ -8,28 +8,27 @@
<script setup> <script setup>
const config = useConfigStore() const config = useConfigStore()
const stateStore = useStateStore() const stateStore = useStateStore()
const maxWorkers = config.app.max_workers
onMounted(() => { onMounted(() => {
if (!config.app.ui_update_title) { if (!config.app.ui_update_title) {
useHead({ title: 'YTPTube' }) useHead({ title: 'YTPTube' })
return return
} }
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` }) useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` })
}) })
watch(() => stateStore.history, () => { watch(() => stateStore.history, () => {
if (!config.app.ui_update_title) { if (!config.app.ui_update_title) {
return return
} }
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` }) useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` })
}, { deep: true }) }, { deep: true })
watch(() => stateStore.queue, () => { watch(() => stateStore.queue, () => {
if (!config.app.ui_update_title) { if (!config.app.ui_update_title) {
return return
} }
useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${maxWorkers} | ${Object.keys(stateStore.history).length || 0} )` }) useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` })
}, { deep: true }) }, { deep: true })
</script> </script>