Skip to content

Commit df28fa7

Browse files
author
share121
committed
fix: 修复进度条显示问题
1 parent 3dd8f93 commit df28fa7

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "fast-down-gui",
4-
"version": "0.1.6",
4+
"version": "0.1.7",
55
"identifier": "com.fast-down.fast-down-gui",
66
"build": {
77
"beforeDevCommand": "bun run dev",

src/components/DownloadItem.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,17 @@ const bgProgress = computed(() =>
115115
)
116116
const detailProgress = computed(() => {
117117
if (!props.fileSize) return []
118-
const t = props.readProgress.flatMap((progress, i, arr) =>
119-
progress
120-
.map(p => ({
118+
const t = props.readProgress
119+
.filter(e => e.length)
120+
.flatMap((progress, i, arr) =>
121+
progress.map(p => ({
121122
width: ((p[1] - p[0]) / props.fileSize) * 100,
122123
left: (p[0] / props.fileSize) * 100,
123124
top: isShow.value ? i * 12 : 0,
124125
background: oklchToRgb(0.8, 0.18, lerp(0, 360, i / arr.length)),
125-
}))
126-
.filter(e => e.width >= 1),
127-
)
126+
})),
127+
)
128+
.filter(e => e.width >= 1)
128129
t.sort((a, b) => a.left - b.left)
129130
return t.map(e => ({
130131
width: e.width + '%',
@@ -221,13 +222,15 @@ async function clickHandler(event: MouseEvent) {
221222
border-radius: 6px;
222223
}
223224
.details > div:first-child {
224-
border-radius: 6px 0 0 6px;
225+
border-top-left-radius: 6px;
226+
border-bottom-left-radius: 6px;
225227
}
226228
.details.open > div:first-child {
227229
border-radius: 6px;
228230
}
229231
.details > div:last-child {
230-
border-radius: 0 6px 6px 0;
232+
border-top-right-radius: 6px;
233+
border-bottom-right-radius: 6px;
231234
}
232235
.details.open > div:last-child {
233236
border-radius: 6px;

0 commit comments

Comments
 (0)