From 0e8492cebaebf710d99f61e0612ae2bc032f1900 Mon Sep 17 00:00:00 2001 From: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Mon, 29 Sep 2025 03:38:29 +0530 Subject: [PATCH] trailing closures in swift --- .../Runner/Background/BackgroundWorkerApiImpl.swift | 8 ++++---- mobile/ios/Runner/Sync/MessagesImpl.swift | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift b/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift index b85bff8bc0..3f7b428b51 100644 --- a/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift +++ b/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift @@ -2,11 +2,11 @@ import BackgroundTasks class BackgroundWorkerApiImpl: BackgroundWorkerFgHostApi { func enable(completion: @escaping (Result) -> Void) { - dispatch(completion: completion, block: { + dispatch(completion: completion) { BackgroundWorkerApiImpl.scheduleRefreshWorker() BackgroundWorkerApiImpl.scheduleProcessingWorker() print("BackgroundWorkerApiImpl:enable Background worker scheduled") - }); + } } func configure(settings: BackgroundWorkerSettings, completion: @escaping (Result) -> Void) { @@ -15,11 +15,11 @@ class BackgroundWorkerApiImpl: BackgroundWorkerFgHostApi { } func disable(completion: @escaping (Result) -> Void) { - dispatch(completion: completion, block: { + dispatch(completion: completion) { BGTaskScheduler.shared.cancel(taskRequestWithIdentifier: BackgroundWorkerApiImpl.refreshTaskID); BGTaskScheduler.shared.cancel(taskRequestWithIdentifier: BackgroundWorkerApiImpl.processingTaskID); print("BackgroundWorkerApiImpl:disableUploadWorker Disabled background workers") - }); + } } private static let refreshTaskID = "app.alextran.immich.background.refreshUpload" diff --git a/mobile/ios/Runner/Sync/MessagesImpl.swift b/mobile/ios/Runner/Sync/MessagesImpl.swift index 6a7b7dc5f8..864da841d2 100644 --- a/mobile/ios/Runner/Sync/MessagesImpl.swift +++ b/mobile/ios/Runner/Sync/MessagesImpl.swift @@ -209,7 +209,7 @@ class NativeSyncApiImpl: NativeSyncApi { } func getAssetIdsForAlbum(albumId: String, completion: @escaping (Result<[String], any Error>) -> Void) { - dispatch(qos: .userInitiated, completion: completion, block: { try self.getAssetIdsForAlbum(albumId: albumId) }) + dispatch(qos: .userInitiated, completion: completion) { try self.getAssetIdsForAlbum(albumId: albumId) } } private func getAssetIdsForAlbum(albumId: String) throws -> [String] { @@ -229,9 +229,9 @@ class NativeSyncApiImpl: NativeSyncApi { } func getAssetsCountSince(albumId: String, timestamp: Int64, completion: @escaping (Result) -> Void) { - dispatch(qos: .userInitiated, completion: completion, block: { + dispatch(qos: .userInitiated, completion: completion) { try self.getAssetsCountSince(albumId: albumId, timestamp: timestamp) - }) + } } private func getAssetsCountSince(albumId: String, timestamp: Int64) throws -> Int64 { @@ -249,9 +249,9 @@ class NativeSyncApiImpl: NativeSyncApi { } func getAssetsForAlbum(albumId: String, updatedTimeCond: Int64?, completion: @escaping (Result<[PlatformAsset], any Error>) -> Void) { - dispatch(qos: .userInitiated, completion: completion, block: { + dispatch(qos: .userInitiated, completion: completion) { try self.getAssetsForAlbum(albumId: albumId, updatedTimeCond: updatedTimeCond) - }) + } } private func getAssetsForAlbum(albumId: String, updatedTimeCond: Int64?) throws -> [PlatformAsset] {