Skip to content

Commit

Permalink
Merge pull request #548 from WalletConnect/bugfix/pairing-subscription
Browse files Browse the repository at this point in the history
[Pair] Pairing request subscription fix
  • Loading branch information
flypaper0 authored Oct 20, 2022
2 parents 3fb5c2a + 2070b1c commit 996dcbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/WalletConnectNetworking/Networking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public class Networking {
return Networking.interactor
}

public static var interactor: NetworkingInteractor {
public static var interactor: NetworkingInteractor = {
guard let _ = Networking.config else {
fatalError("Error - you must call Networking.configure(_:) before accessing the shared instance.")
}

return NetworkingClientFactory.create(relayClient: Relay.instance)
}
}()

public static var projectId: String {
guard let projectId = config?.projectId else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public class PingResponseSubscriber {
networkingInteractor.responseSubscription(on: method)
.sink { [unowned self] (payload: ResponseSubscriptionPayload<PairingPingParams, Bool>) in
onResponse?(payload.topic)

Task(priority: .high) {
try await networkingInteractor.respondSuccess(
topic: payload.topic,
requestId: payload.id,
protocolMethod: method
)
}
}
.store(in: &publishers)
}
Expand Down

0 comments on commit 996dcbd

Please sign in to comment.