mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 12:06:21 +01:00
FIX: Issue: Apple Watch invoice gets stuck #1529
This commit is contained in:
parent
fd82a9b938
commit
e360fa443f
3 changed files with 15 additions and 6 deletions
|
@ -55,7 +55,7 @@ class ReceiveInterfaceController: WKInterfaceController {
|
|||
self?.toggleViewButtonPressed()
|
||||
WCSession.default.sendMessage(["message": "fetchTransactions"], replyHandler: nil, errorHandler: nil)
|
||||
} else {
|
||||
self?.presentAlert(withTitle: "Error", message: "Unable to create invoice. Please, make sure your iPhone is paired and nearby.", preferredStyle: .alert, actions: [WKAlertAction(title: "OK", style: .default, handler: { [weak self] in
|
||||
self?.presentAlert(withTitle: "Error", message: "Unable to create invoice. Please open BlueWallet on your iPhone and unlock your wallets.", preferredStyle: .alert, actions: [WKAlertAction(title: "OK", style: .default, handler: { [weak self] in
|
||||
self?.dismiss()
|
||||
self?.pop()
|
||||
})])
|
||||
|
|
|
@ -89,8 +89,14 @@ class SpecifyInterfaceController: WKInterfaceController {
|
|||
}
|
||||
|
||||
@IBAction func createButtonTapped() {
|
||||
NotificationCenter.default.post(name: NotificationName.createQRCode, object: specifiedQRContent)
|
||||
dismiss()
|
||||
if (WCSession.default.activationState == .activated) {
|
||||
NotificationCenter.default.post(name: NotificationName.createQRCode, object: specifiedQRContent)
|
||||
dismiss()
|
||||
} else {
|
||||
presentAlert(withTitle: "Error", message: "Unable to create invoice. Please open BlueWallet on your iPhone and unlock your wallets.", preferredStyle: .alert, actions: [WKAlertAction(title: "OK", style: .default, handler: { [weak self] in
|
||||
self?.dismiss()
|
||||
})])
|
||||
}
|
||||
}
|
||||
|
||||
override func contextForSegue(withIdentifier segueIdentifier: String) -> Any? {
|
||||
|
|
|
@ -92,7 +92,6 @@ class WalletDetailsInterfaceController: WKInterfaceController {
|
|||
transactionsTable.setHidden(wallet?.transactions.isEmpty ?? true)
|
||||
noTransactionsLabel.setHidden(!(wallet?.transactions.isEmpty ?? false))
|
||||
receiveButton.setHidden(wallet?.receiveAddress.isEmpty ?? true)
|
||||
createInvoiceButton.setEnabled(WCSession.default.isReachable)
|
||||
}
|
||||
|
||||
@IBAction func receiveMenuItemTapped() {
|
||||
|
@ -116,9 +115,13 @@ class WalletDetailsInterfaceController: WKInterfaceController {
|
|||
}
|
||||
|
||||
@IBAction func createInvoiceTapped() {
|
||||
if (WCSession.default.isReachable) {
|
||||
if (WCSession.default.activationState == .activated) {
|
||||
pushController(withName: ReceiveInterfaceController.identifier, context: (wallet?.identifier, "createInvoice"))
|
||||
}
|
||||
} else {
|
||||
presentAlert(withTitle: "Error", message: "Unable to create invoice. Please open BlueWallet on your iPhone and unlock your wallets.", preferredStyle: .alert, actions: [WKAlertAction(title: "OK", style: .default, handler: { [weak self] in
|
||||
self?.dismiss()
|
||||
})])
|
||||
}
|
||||
}
|
||||
|
||||
override func contextForSegue(withIdentifier segueIdentifier: String) -> Any? {
|
||||
|
|
Loading…
Add table
Reference in a new issue