Skip to content

Commit 407ea62

Browse files
author
Ruben Nine
committed
Initializing progress object at initialization rather than after upload starts.
1 parent b82dc6d commit 407ea62

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

FilestackSDK/Public/Models/MultipartUpload.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extension MultipartUploadError: LocalizedError {
8383
self.options = options
8484
self.security = security
8585
self.shouldAbort = false
86-
self.progress = Progress(totalUnitCount: 0)
86+
self.progress = Progress(totalUnitCount: Int64(uploadable.size ?? 0))
8787

8888
uploadOperationQueue.underlyingQueue = uploadOperationUnderlyingQueue
8989
uploadOperationQueue.maxConcurrentOperationCount = options.partUploadConcurrency
@@ -164,8 +164,6 @@ private extension MultipartUpload {
164164
return
165165
}
166166

167-
progress = Progress(totalUnitCount: Int64(fileSize))
168-
169167
let startOperation = MultipartUploadStartOperation(apiKey: apiKey,
170168
fileName: fileName,
171169
fileSize: fileSize,

0 commit comments

Comments
 (0)