Skip to content

Commit

Permalink
Merge branch 'feature/WC2_tech_debt' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Jan 5, 2024
2 parents fc56b10 + 750894f commit 7db3423
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 10 additions & 1 deletion Kukai Mobile/Modules/Home/HomeTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,20 @@ extension HomeTabBarController: WalletConnectServiceDelegate {
}

public func signRequested() {
self.loadingViewHideActivityAndFade(withDuration: 0.5)
self.performSegue(withIdentifier: "wallet-connect-sign", sender: nil)
}

public func processingIncomingOperations() {
self.showLoadingView()
DispatchQueue.main.async {
self.showLoadingView()
}
}

public func processingIncomingDone() {
DispatchQueue.main.async {
self.hideLoadingView()
}
}

public func processedOperations(ofType: WalletConnectOperationType) {
Expand Down
8 changes: 5 additions & 3 deletions Kukai Mobile/Services/WalletConnectService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public protocol WalletConnectServiceDelegate: AnyObject {
func pairRequested()
func signRequested()
func processingIncomingOperations()
func processingIncomingDone()
func processedOperations(ofType: WalletConnectOperationType)
func error(message: String?, error: Error?)
func connectionStatusChanged(status: SocketConnectionStatus)
Expand Down Expand Up @@ -241,7 +242,8 @@ public class WalletConnectService {
// Setup listener for completion status
self.$requestDidComplete
.dropFirst()
.sink(receiveValue: { value in
.sink(receiveValue: { [weak self] value in
self?.delegate?.processingIncomingDone()
promise(.success(value))
})
.store(in: &self.bag)
Expand Down Expand Up @@ -741,8 +743,8 @@ public class WalletConnectService {
}

private func mainThreadProcessedOperations(ofType type: WalletConnectOperationType) {
DispatchQueue.main.async {
self.delegate?.processedOperations(ofType: type)
DispatchQueue.main.async { [weak self] in
self?.delegate?.processedOperations(ofType: type)
}
}
}

0 comments on commit 7db3423

Please sign in to comment.