Add unzip status

This commit is contained in:
Lncvrt committed 2026-03-10 20:35:26 -07:00
1 parent c65fb5e1a5
commit 0b4e639630
4 files changed
+63 -21

No files matched your search

+25 -3
View File
@@ -235,13 +235,33 @@ export default function RootLayout ({
)
unlisteners.push(
await listen<string>('download-finishing', event => {
await listen<string>('unzip-start', event => {
const displayName = event.payload
setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === displayName)
if (i === -1) return prev
const copy = [...prev]
copy[i] = { ...copy[i], hash_checking: false, finishing: true }
copy[i] = { ...copy[i], hash_checking: false, unzipping: true }
return copy
})
})
)
unlisteners.push(
await listen<string>('unzip-progress', async event => {
const [displayName, unzippedStr, unzipTotalStr] =
event.payload.split(':')
const unzipped = Number(unzippedStr)
const unzipTotal = Number(unzipTotalStr)
setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === displayName)
if (i === -1) return prev
const copy = [...prev]
copy[i] = {
...copy[i],
unzipped,
unzipTotal
}
return copy
})
})
@@ -331,9 +351,11 @@ export default function RootLayout ({
false,
true,
false,
false,
0,
0,
0,
false,
0,
0
)
)
+13 -8
View File
@@ -52,15 +52,20 @@ export default function DownloadsPopup () {
Remove
</button>
</div>
) : v.hash_checking || v.finishing ? (
<span
className={`${
v.hash_checking ? 'text-blue-300' : 'text-green-300'
} inline-block w-full text-center`}
>
{v.hash_checking ? 'Verifying file integerty' : 'Finishing'}
...
) : v.hash_checking ? (
<span className='text-blue-300 inline-block w-full text-center'>
Verifying file integerty...
</span>
) : v.unzipping ? (
<div className='flex flex-col gap-1 w-full'>
<span className='text-center'>
Unzipped {v.unzipped} / {v.unzipTotal} files
</span>
<ProgressBar
progress={(v.unzipped / v.unzipTotal) * 100}
className='w-full'
/>
</div>
) : (
<div className='flex flex-col gap-1 w-full'>
<span className='text-center'>
+4 -2
View File
@@ -6,9 +6,11 @@ export class DownloadProgress {
public failed: boolean,
public queued: boolean,
public hash_checking: boolean,
public finishing: boolean,
public speed: number,
public size: number,
public etaSecs: number
public etaSecs: number,
public unzipping: boolean,
public unzipTotal: number,
public unzipped: number
) {}
}