diff --git a/TalerWallet1/Views/Balances/DiscountPasses.swift b/TalerWallet1/Views/Balances/DiscountPasses.swift index 8d25119e..c0661711 100755 --- a/TalerWallet1/Views/Balances/DiscountPasses.swift +++ b/TalerWallet1/Views/Balances/DiscountPasses.swift @@ -91,17 +91,7 @@ struct DiscountsPassesItem: View { } .padding(.horizontal) .padding(.top, 6) - if isValid { - row - } else { - let swipe = Button { - symLog.log("delete \(token.id)") - deleteAction(token.id) - } label: { - Label("Delete", systemImage: "trash") - }.tint(WalletColors().negative) - row.swipeActions(edge: .trailing) { swipe } - } + row // Divider() desc .padding(.horizontal) @@ -117,6 +107,23 @@ struct DiscountsPassesItem: View { .padding(.horizontal) .padding(.vertical, 4) } + // `.swipeActions` only takes effect on a direct row of the List. + // It used to be attached to `row`, the HStack *inside* this + // VStack, where it did nothing -- and only in the `else` branch of + // `if isValid`, i.e. only for a token whose validity had not + // started yet, which is never a token the user just earned and + // never anything under "Expired". Between the two, the only call + // site of `deleteAction` could not be reached at all: a token + // could not be removed from the wallet. See issue 11962. + .swipeActions(edge: .trailing) { + Button(role: .destructive) { + symLog.log("delete \(token.id)") + deleteAction(token.id) + } label: { + Label("Delete", systemImage: "trash") + } + .tint(WalletColors().negative) + } ContainerRelativeShape() .fill(isValid ? primaryAccent.opacity(0.1) : .clear)