fix: disable Download button after completion, reset on format change

This commit is contained in:
mini
2026-02-18 22:44:54 +08:00
parent d3eed07e44
commit 25c4973f57

View File

@@ -20,15 +20,15 @@
<div class="formats">
<h4>Select Quality:</h4>
<div v-for="fmt in videoInfo.formats" :key="fmt.format_id" class="format-item"
:class="{ selected: selectedFormat === fmt.format_id }" @click="selectedFormat = fmt.format_id">
:class="{ selected: selectedFormat === fmt.format_id }" @click="selectedFormat = fmt.format_id; downloadReady = false; taskId = ''; progress = 0">
<span class="quality">{{ fmt.quality }}</span>
<span class="ext">{{ fmt.ext }}</span>
<span v-if="fmt.filesize" class="size">~{{ humanSize(fmt.filesize) }}</span>
</div>
</div>
<button class="download-btn" @click="startDownload" :disabled="downloading">
{{ downloading ? '⏳ Downloading...' : '📥 Download' }}
<button class="download-btn" @click="startDownload" :disabled="downloading || downloadReady">
{{ downloading ? '⏳ Downloading...' : downloadReady ? '✅ Downloaded' : '📥 Download' }}
</button>
</div>