Revert "Bh updates to improve wallet selector"

This commit is contained in:
Suhail Saqan
2022-12-29 23:30:56 -08:00
committed by GitHub
parent 0bcabc8e08
commit 403a22125a
8 changed files with 177 additions and 162 deletions

View File

@@ -15,19 +15,19 @@ struct InvoiceView: View {
let invoice: Invoice
@State var showingSelectWallet: Bool = false
@State var inv: String = ""
@ObservedObject var user_settings = UserSettingsStore()
@StateObject var user_settings = UserSettingsStore()
var PayButton: some View {
Button {
inv = invoice.string
if user_settings.showWalletSelector {
if (user_settings.showwalletselector){
showingSelectWallet = true
} else {
let walletModel = user_settings.defaultWallet.model
if let url = URL(string: "\(walletModel.link)\(inv)"), UIApplication.shared.canOpenURL(url) {
let wallet = get_default_wallet(user_settings.defaultwallet.rawValue)
if let url = URL(string: "\(wallet.link)\(inv)"), UIApplication.shared.canOpenURL(url) {
openURL(url)
} else {
if let url = URL(string: walletModel.appStoreLink), UIApplication.shared.canOpenURL(url) {
if let url = URL(string: wallet.appStoreLink), UIApplication.shared.canOpenURL(url) {
openURL(url)
}
}