Skip to content

Commit 7082949

Browse files
harryyan1238gmagpayo
authored andcommitted
IOS-6729: add task cancel for file search
(cherry picked from commit bd4192b)
1 parent 9de59b6 commit 7082949

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

iMEGA/Home/Repository/SDK/SDKFilesSearchRepository.swift

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ final class SDKFilesSearchRepository: FilesSearchRepositoryProtocol {
4545
formatType: MEGANodeFormatType) async throws -> [MEGANode] {
4646
return try await withCheckedThrowingContinuation({ continuation in
4747
search(string: string, inNode: node, sortOrderType: sortOrderType, formatType: formatType) {
48+
guard Task.isCancelled == false else { continuation.resume(throwing: FileSearchResultErrorEntity.cancelled); return }
49+
4850
continuation.resume(with: $0)
4951
}
5052
})

0 commit comments

Comments
 (0)