Skip to content

Commit

Permalink
Merge branch 'feature/ui_updates' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Dec 1, 2023
2 parents 998a506 + 7bece5d commit 5bde863
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Kukai Mobile/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
return
}

if url.absoluteString.prefix(12) == "kukai://wc2/" {
let wc2URI = url.absoluteString.dropFirst(12)
if url.absoluteString.prefix(10) == "kukai://wc" {
var wc2URI = String(url.absoluteString.dropFirst(15)) // just strip off "kukai://wc?uri="
wc2URI = wc2URI.removingPercentEncoding ?? ""

if let uri = WalletConnectURI(string: String(wc2URI)) {
WalletConnectService.shared.uriToOpenOnAppReturn = uri
WalletConnectService.shared.pairClient(uri: uri)
return
}
} else {
WalletConnectService.shared.uriToOpenOnAppReturn = nil
}

CustomAuth.handle(url: url)
Expand Down
4 changes: 1 addition & 3 deletions Kukai Mobile/Services/WalletConnectService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ public class WalletConnectService {

public static let shared = WalletConnectService()
public weak var delegate: WalletConnectServiceDelegate? = nil
public var uriToOpenOnAppReturn: WalletConnectURI? = nil

private static let projectId = "97f804b46f0db632c52af0556586a5f3"
private static let metadata = AppMetadata(name: "Kukai iOS",
description: "Kukai iOS",
url: "https://wallet.kukai.app",
icons: ["https://wallet.kukai.app/assets/img/header-logo.svg"],
redirect: AppMetadata.Redirect(native: "kukai://app", universal: nil))
redirect: AppMetadata.Redirect(native: "kukai://", universal: nil))

@Published public var didCleanAfterDelete: Bool = false
@Published public var requestDidComplete: Bool = false
Expand Down Expand Up @@ -232,7 +231,6 @@ public class WalletConnectService {
Task {
do {
try await Pair.instance.pair(uri: uri)
uriToOpenOnAppReturn = nil

} catch {
Logger.app.error("WC Pairing connect error: \(error)")
Expand Down

0 comments on commit 5bde863

Please sign in to comment.