From b876f574fe4f35ae03eaf17090075bba68d3af97 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Tue, 30 Jan 2024 19:38:46 +0000 Subject: [PATCH] add modal precheck to pair and sign requests --- .../Modules/Home/HomeTabBarController.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Kukai Mobile/Modules/Home/HomeTabBarController.swift b/Kukai Mobile/Modules/Home/HomeTabBarController.swift index 509405b3..a6e5249d 100644 --- a/Kukai Mobile/Modules/Home/HomeTabBarController.swift +++ b/Kukai Mobile/Modules/Home/HomeTabBarController.swift @@ -473,12 +473,22 @@ extension HomeTabBarController: WalletConnectServiceDelegate { } public func pairRequested() { - self.performSegue(withIdentifier: "wallet-connect-pair", sender: nil) + if self.presentedViewController == nil { + self.performSegue(withIdentifier: "wallet-connect-pair", sender: nil) + } else { + WalletConnectService.rejectCurrentProposal(completion: nil) + self.windowError(withTitle: "error".localized(), description: "error-wc2-cant-open-more-modals".localized()) + } } public func signRequested() { self.loadingViewHideActivityAndFade(withDuration: 0.5) - self.performSegue(withIdentifier: "wallet-connect-sign", sender: nil) + if self.presentedViewController == nil { + self.performSegue(withIdentifier: "wallet-connect-sign", sender: nil) + } else { + WalletConnectService.rejectCurrentRequest(completion: nil) + self.windowError(withTitle: "error".localized(), description: "error-wc2-cant-open-more-modals".localized()) + } } public func processingIncomingOperations() {