Skip to content

Commit

Permalink
Merge pull request #1152 from WalletConnect/develop
Browse files Browse the repository at this point in the history
1.8.6
  • Loading branch information
alexander-lsvk authored Oct 3, 2023
2 parents 2f2b22e + 4931b29 commit b1b2486
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class NotifyWatchSubscriptionsResponseSubscriber {
let oldSubscriptions = notifyStorage.getSubscriptions()
let newSubscriptions = try await notifySubscriptionsBuilder.buildSubscriptions(responsePayload.subscriptions)

try Task.checkCancellation()

logger.debug("number of subscriptions: \(newSubscriptions.count)")

guard newSubscriptions != oldSubscriptions else {return}
Expand Down
2 changes: 1 addition & 1 deletion Sources/WalletConnectRelay/PackageConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "1.8.5"}
{"version": "1.8.6"}
39 changes: 23 additions & 16 deletions Sources/WalletConnectUtils/WalletConnectURI.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import UIKit
import Foundation

public struct WalletConnectURI: Equatable {

public let topic: String
public let version: String
public let symKey: String
Expand Down Expand Up @@ -51,20 +50,6 @@ public struct WalletConnectURI: Equatable {
}
return nil
}

public init?(connectionOptions: UIScene.ConnectionOptions) {
if let uri = connectionOptions.urlContexts.first?.url.query?.replacingOccurrences(of: "uri=", with: "") {
self.init(string: uri)
}
return nil
}

public init?(urlContext: UIOpenURLContext) {
if let uri = urlContext.url.query?.replacingOccurrences(of: "uri=", with: "") {
self.init(string: uri)
}
return nil
}

private var relayQuery: String {
var query = "relay-protocol=\(relay.protocol)"
Expand All @@ -82,3 +67,25 @@ public struct WalletConnectURI: Equatable {
return URLComponents(string: urlString)
}
}

#if canImport(UIKit)

import UIKit

extension WalletConnectURI {
public init?(connectionOptions: UIScene.ConnectionOptions) {
if let uri = connectionOptions.urlContexts.first?.url.query?.replacingOccurrences(of: "uri=", with: "") {
self.init(string: uri)
}
return nil
}

public init?(urlContext: UIOpenURLContext) {
if let uri = urlContext.url.query?.replacingOccurrences(of: "uri=", with: "") {
self.init(string: uri)
}
return nil
}
}

#endif

0 comments on commit b1b2486

Please sign in to comment.