Skip to content

Commit 88bc230

Browse files
committed
[trello.com/c/7YVA2NTe] add explanation for uploadTasks
1 parent fee0c37 commit 88bc230

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Adamant/Modules/Chat/ViewModel/ChatFileService.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ final class ChatFileService: ChatFileProtocol, Sendable {
4949
private var fileDownloadAttemptsCount: [String: Int] = [:]
5050
private var uploadingFilesDictionary: [String: FileMessage] = [:]
5151
private var previewDownloadsAttemps: [String: Int] = [:]
52-
private var uploadTasks: [String: [String: Task<UploadFileResult, Error>]] = [:]
5352
private let synchronizer = AsyncStreamSender<@MainActor () -> Void>()
5453
private let _updateFileFields = ObservableSender<FileUpdateProperties>()
54+
55+
// [messageId: [fileID: Task]] we can cancel all tasks for one message by messageId, uploading is managing by fileID
56+
private var uploadTasks: [String: [String: Task<UploadFileResult, Error>]] = [:]
5557

5658
private var subscriptions = Set<AnyCancellable>()
5759
private let maxDownloadAttemptsCount = 3

0 commit comments

Comments
 (0)