🐛 修复安装时进度条 0%

This commit is contained in:
柚子
2025-03-07 01:38:56 +08:00
parent b6928c3bb1
commit f9a6fcbf84

View File

@@ -26,8 +26,13 @@ const DownloadCard: Component<{ download: DownloadTask }> = (props) => {
</div>
</div>
<div class="flex items-center gap-2">
<Progress value={props.download.progress} class="flex-1" />
<span class="text-sm text-muted-foreground">{props.download.progress}%</span>
<Progress
value={['installing', 'installed'].includes(props.download.status) ? 100 : props.download.progress}
class="flex-1"
/>
<span class="text-sm text-muted-foreground">
{['installing', 'installed'].includes(props.download.status) ? 100 : props.download.progress}%
</span>
{(props.download.status === 'downloading' || props.download.status === 'queued') && (
<Button
size="icon"