Skip to content

Commit

Permalink
Run swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Mar 15, 2024
1 parent 91861a0 commit 145ba70
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ public class DropboxClientsManager {
}
}

public static func reauthorizeClient(_ tokenUid: String, transportClient: DropboxTransportClient? = nil, sessionConfiguration: NetworkSessionConfiguration? = nil) {
public static func reauthorizeClient(
_ tokenUid: String,
transportClient: DropboxTransportClient? = nil,
sessionConfiguration: NetworkSessionConfiguration? = nil
) {
precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method")

if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) {
Expand All @@ -159,12 +163,21 @@ public class DropboxClientsManager {
precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method")

if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) {
setupAuthorizedBackgroundClient(token, transportClient: transportClient, sessionConfiguration: sessionConfiguration, requestsToReconnect: requestsToReconnect)
setupAuthorizedBackgroundClient(
token,
transportClient: transportClient,
sessionConfiguration: sessionConfiguration,
requestsToReconnect: requestsToReconnect
)
}
checkAccessibilityMigrationOneTime(oauthManager: DropboxOAuthManager.sharedOAuthManager)
}

public static func reauthorizeTeamClient(_ tokenUid: String, transportClient: DropboxTransportClient? = nil, sessionConfiguration: NetworkSessionConfiguration? = nil) {
public static func reauthorizeTeamClient(
_ tokenUid: String,
transportClient: DropboxTransportClient? = nil,
sessionConfiguration: NetworkSessionConfiguration? = nil
) {
precondition(DropboxOAuthManager.sharedOAuthManager != nil, "Call `DropboxClientsManager.setupWithAppKey` before calling this method")

if let token = DropboxOAuthManager.sharedOAuthManager.getAccessToken(tokenUid) {
Expand Down Expand Up @@ -389,7 +402,6 @@ public class DropboxClientsManager {
)
}


/// Handle a redirect and automatically initialize the client and save the token.
///
/// - parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ public class DropboxTransportClientImpl: DropboxTransportClientInternal {

self.headersForRouteHost = headersForRouteHost


// below this self is initialized

let apiRequestCreation: ApiRequestCreation = { [weak self] taskCreation, onTaskCreation in
Expand All @@ -238,7 +237,6 @@ public class DropboxTransportClientImpl: DropboxTransportClientInternal {
)
}


manager.apiRequestCreation = apiRequestCreation
longpollManager.apiRequestCreation = apiRequestCreation
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ extension NetworkSessionManager {
}

guard let apiRequest = apiRequestCreation?(taskCreation, onTaskCreation) else {
fatalError("ApiRequestCreation missing: You must set the `apiRequestCreation` block on a NetworkSessionManager before attempting to make requests")
fatalError(
"ApiRequestCreation missing: You must set the `apiRequestCreation` block on a NetworkSessionManager before attempting to make requests"
)
}

return apiRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ public class DBXDropboxClientsManager: NSObject {
backgroundSessionTransportClient: DBXDropboxTransportClient?,
sessionConfiguration: DBXNetworkSessionConfiguration?,
backgroundSessionConfiguration: DBXNetworkSessionConfiguration?,
completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> Bool
{
completion: @escaping (DBXDropboxOAuthResult?) -> Void
) -> Bool {
DropboxClientsManager.handleRedirectURL(
url,
includeBackgroundClient: includeBackgroundClient,
transportClient: transportClient?.swift,
backgroundSessionTransportClient: backgroundSessionTransportClient?.swift,
sessionConfiguration: sessionConfiguration?.swift,
backgroundSessionConfiguration: backgroundSessionConfiguration?.swift,
completion: bridgeDropboxOAuthCompletion(completion)
completion: bridgeDropboxOAuthCompletion(completion)
)
}

Expand All @@ -147,8 +147,18 @@ public class DBXDropboxClientsManager: NSObject {
/// - returns: Whether the redirect URL can be handled.
@objc
@discardableResult
public static func handleRedirectURLTeam(_ url: URL, transportClient: DBXDropboxTransportClient?, sessionConfiguration: DBXNetworkSessionConfiguration?, completion: @escaping (DBXDropboxOAuthResult?) -> Void) -> Bool {
DropboxClientsManager.handleRedirectURLTeam(url, transportClient: transportClient?.swift, sessionConfiguration: sessionConfiguration?.swift, completion: bridgeDropboxOAuthCompletion(completion))
public static func handleRedirectURLTeam(
_ url: URL,
transportClient: DBXDropboxTransportClient?,
sessionConfiguration: DBXNetworkSessionConfiguration?,
completion: @escaping (DBXDropboxOAuthResult?) -> Void
) -> Bool {
DropboxClientsManager.handleRedirectURLTeam(
url,
transportClient: transportClient?.swift,
sessionConfiguration: sessionConfiguration?.swift,
completion: bridgeDropboxOAuthCompletion(completion)
)
}

/// Prepare the appropriate single user DropboxClient to handle incoming background session events and make ongoing tasks available for reconnection
Expand Down

0 comments on commit 145ba70

Please sign in to comment.