fix: infinity showed when haven't get total size (#2066)
Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
This commit is contained in:
parent
56034d682a
commit
20eb5eccae
@ -130,8 +130,8 @@ export const setDownloadStateAtom = atom(
|
||||
0
|
||||
)
|
||||
modelDownloadState.size.transferred = transferredSize
|
||||
modelDownloadState.percent = transferredSize / parentTotalSize
|
||||
|
||||
modelDownloadState.percent =
|
||||
parentTotalSize === 0 ? 0 : transferredSize / parentTotalSize
|
||||
currentState[state.modelId] = modelDownloadState
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user