Skip to content

Commit

Permalink
Update router
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-lsvk committed Oct 30, 2023
1 parent 448ec76 commit 56aa06f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ let package = Package(
.target(
name: "WalletConnectNetworking",
dependencies: ["HTTPClient", "WalletConnectRelay"]),
.target(
name: "WalletConnectRouter",
dependencies: [],
path: "Sources/WalletConnectRouter/Router"),
.target(
name: "WalletConnectRouterLegacy",
dependencies: [],
path: "Sources/WalletConnectRouter/RouterLegacy"),
.target(
name: "WalletConnectRouter",
dependencies: ["WalletConnectRouterLegacy"],
path: "Sources/WalletConnectRouter/Router"),
.target(
name: "WalletConnectVerify",
dependencies: ["WalletConnectUtils", "WalletConnectNetworking"]),
Expand Down
12 changes: 10 additions & 2 deletions Sources/WalletConnectRouter/Router/Router.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import UIKit

@_exported import WalletConnectRouter

public struct WalletConnectRouter {
public static func goBack(uri: String) {
DispatchQueue.main.async {
UIApplication.shared.open(URL(string: uri)!)
if #available(iOS 17, *) {
DispatchQueue.main.async {
if let url = URL(string: uri) {
UIApplication.shared.open(url)
}
}
} else {
Router.goBack()
}
}
}

0 comments on commit 56aa06f

Please sign in to comment.