mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
fix: adjust alreadyUploadSize computation to prevent exceeding total file size
This commit is contained in:
@@ -27,7 +27,7 @@ const fileSliceUploadStatusList = ref<
|
||||
>([])
|
||||
|
||||
const successCount = computed(() => fileSliceUploadStatusList.value.filter((item) => item.status === 'success').length)
|
||||
const alreadyUploadSize = computed(() => successCount.value * chunkSize.value)
|
||||
const alreadyUploadSize = computed(() => Math.min(successCount.value * chunkSize.value, props?.data?.file?.size))
|
||||
const uploadProgress = computed(() => Math.round((alreadyUploadSize.value / (props?.data?.file?.size || 0)) * 100))
|
||||
|
||||
const { error } = useAsyncState(async () => {
|
||||
|
||||
Reference in New Issue
Block a user