Bug fix - unable to select the same payment multiple times in a row (after dismissing sheet via slide-to-dismiss)
@@ -178,7 +178,15 @@ struct HomeView : MVIView, ViewName {
}
}
}
- .sheet(isPresented: .constant(selectedPayment != nil)) {
+ }
+
+ BottomBar(toast: toast)
+
+ } // </VStack>
+ .sheet(isPresented: Binding(
+ get: { selectedPayment != nil },
+ set: { if !$0 { selectedPayment = nil }} // needed if user slides the sheet to dismiss
+ )) {
PaymentView(
payment: selectedPayment!,
@@ -188,11 +196,6 @@ struct HomeView : MVIView, ViewName {
}
}
- BottomBar(toast: toast)
-
- } // </VStack>
- }
-
func incomingAmount() -> FormattedAmount? {
let msatTotal = lastIncomingSwaps.values.reduce(Int64(0)) {(sum, item) -> Int64 in
