Skip to content

Commit

Permalink
Add explanation for duplicate call
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Dec 7, 2023
1 parent 80913f4 commit ad579a4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ final class ThreadClientService: THClientProtocol {

func retrieveAllCredentials() async throws -> [ThreadCredential] {
let placeholder = "Unknown"

// Thre preferred credential call is necessary as it triggers a permission dialog
let preferredCredential = try await client.preferredCredentials()

// All credentials retrieve the rest of the credentials after user acceps permission dialog
var allCredentials = try await client.allCredentials()
allCredentials = allCredentials.filter { $0.borderAgentID != preferredCredential.borderAgentID }
allCredentials.insert(preferredCredential)
Expand Down

0 comments on commit ad579a4

Please sign in to comment.