Skip to content

Commit 86ca1c6

Browse files
committed
[FIx] Edge case where downloaded size is bigger than download size
1 parent a5d8ccd commit 86ca1c6

File tree

1 file changed

+10
-3
lines changed
  • src/frontend/components/UI/DownloadToastManager

1 file changed

+10
-3
lines changed

src/frontend/components/UI/DownloadToastManager/index.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,16 @@ export default function DownloadToastManager() {
160160
return 'inProgress'
161161
}
162162

163-
const adjustedDownloadedInBytes = downloadedMB * 1024 * 1024
164-
const adjustedDownloadSizeInBytes =
165-
progress.totalSize || installInfo?.manifest.download_size || 0
163+
let adjustedDownloadedInBytes = downloadedMB * 1024 * 1024
164+
const adjustedDownloadSizeInBytes = isExtracting
165+
? installInfo?.manifest.disk_size || 0
166+
: installInfo?.manifest.download_size || 0
167+
168+
if (isExtracting) {
169+
if (adjustedDownloadedInBytes > adjustedDownloadSizeInBytes) {
170+
adjustedDownloadedInBytes = adjustedDownloadSizeInBytes
171+
}
172+
}
166173

167174
return (
168175
<Draggable>

0 commit comments

Comments
 (0)