Skip to content

Commit

Permalink
- bump library version to prevent connection subject from cancelling
Browse files Browse the repository at this point in the history
- allow confirmation pages to recheck ledger state after returning from background
  • Loading branch information
simonmcl committed Oct 23, 2024
1 parent ba494fc commit 19ec442
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"location" : "https://github.com/kukai-wallet/kukai-core-swift",
"state" : {
"branch" : "develop",
"revision" : "f770faee2bd4115bb7871bd87641587ac3434f70"
"revision" : "d6cd2708de8520f53a0450ddb5e2b64fae7a3709"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class WalletConnectSignViewController: UIViewController, BottomSheetCustomFixedP
}
.store(in: &bag)
*/

NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification).sink { [weak self] _ in
self?.ledgerCheck()
}.store(in: &bag)
}

override func viewWillAppear(_ animated: Bool) {
Expand All @@ -88,6 +92,10 @@ class WalletConnectSignViewController: UIViewController, BottomSheetCustomFixedP
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

ledgerCheck()
}

private func ledgerCheck() {
if let meta = DependencyManager.shared.walletList.metadata(forAddress: accountToSign), meta.type == .ledger {
AccountsViewModel.askToConnectToLedgerIfNeeded(walletMetadata: meta) { success in
if !success {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class SendAbstractConfirmViewController: UIViewController {
}
.store(in: &bag)
*/

NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification).sink { [weak self] _ in
self?.ledgerCheck()
}.store(in: &bag)
}

override func viewWillAppear(_ animated: Bool) {
Expand All @@ -66,6 +70,10 @@ class SendAbstractConfirmViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

ledgerCheck()
}

private func ledgerCheck() {
if let meta = selectedMetadata, meta.type == .ledger {
AccountsViewModel.askToConnectToLedgerIfNeeded(walletMetadata: meta) { success in
if !success {
Expand Down

0 comments on commit 19ec442

Please sign in to comment.