zaps: Implement single-tap zap on profile action sheet and fix zap fallthrough on default settings
This commit implements a single-tap zap on the profile action sheet and fixes an issue where zapping would silently fail on default settings if the user had no lightning wallet installed in their system. Testing ------- Configurations: - iPhone 13 Mini (physical device) on iOS 17.0.2 with NWC wallet attached - iPhone 15 Pro (simulator) on iOS 17.0.1 with no lightning wallet nor NWC Damus: This commit Coverage: - Zapping using NWC connected wallet: PASS (Zaps and shows UX feedback of the completed action) - Zapping under default settings and no lightning wallet: PASS (Shows the wallet selector invoice view) - Long press on zap button brings custom zap view Regression testing ------------------ Preconditions: iPhone 15 Pro (simulator) on iOS 17.0.1 with no lightning wallet nor NWC Coverage: - Zapping user on their full profile shows wallet selector. PASS - On-post invoice shows wallet selector. PASS Closes: https://github.com/damus-io/damus/issues/1634 Changelog-Changed: Zap button on profile action sheet now zaps with a single click, while a long press brings custom zap view Changelog-Fixed: Fixed an issue where zapping would silently fail on default settings if the user does not have a lightning wallet preinstalled on their device. Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
139df33cb7
commit
692d29942b
@@ -38,7 +38,8 @@ struct SelectWalletView: View {
|
||||
Section(NSLocalizedString("Select a Lightning wallet", comment: "Title of section for selecting a Lightning wallet to pay a Lightning invoice.")) {
|
||||
List{
|
||||
Button() {
|
||||
open_with_wallet(wallet: default_wallet.model, invoice: invoice)
|
||||
// TODO: Handle cases where wallet cannot be opened by the system
|
||||
try? open_with_wallet(wallet: default_wallet.model, invoice: invoice)
|
||||
} label: {
|
||||
HStack {
|
||||
Text("Default Wallet", comment: "Button to pay a Lightning invoice with the user's default Lightning wallet.").font(.body).foregroundColor(.blue)
|
||||
@@ -47,7 +48,8 @@ struct SelectWalletView: View {
|
||||
List($allWalletModels) { $wallet in
|
||||
if wallet.index >= 0 {
|
||||
Button() {
|
||||
open_with_wallet(wallet: wallet, invoice: invoice)
|
||||
// TODO: Handle cases where wallet cannot be opened by the system
|
||||
try? open_with_wallet(wallet: wallet, invoice: invoice)
|
||||
} label: {
|
||||
HStack {
|
||||
Image(wallet.image).resizable().frame(width: 32.0, height: 32.0,alignment: .center).cornerRadius(5)
|
||||
|
||||
Reference in New Issue
Block a user