Skip to content

Commit d059642

Browse files
committed
Update booking order validation
1 parent e798902 commit d059642

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

WooCommerce/Classes/Extensions/Booking+Helpers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ extension Booking {
1919
.joined(separator: "")
2020
}
2121

22-
var isOrderValid: Bool {
23-
return orderID != 0
22+
var hasAssociatedOrder: Bool {
23+
return orderID > 0
2424
}
2525

2626
private enum Localization {

WooCommerce/Classes/ViewModels/Booking Details/BookingDetailsViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private extension BookingDetailsViewModel {
8484

8585
func updateDisplayProperties(from booking: Booking) {
8686
navigationTitle = Self.navigationTitle(for: booking)
87-
isViewOrderAvailable = booking.isOrderValid
87+
isViewOrderAvailable = booking.hasAssociatedOrder
8888

8989
headerContent.update(with: booking)
9090

WooCommerce/Classes/ViewModels/Booking Details/PaymentContent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension BookingDetailsViewModel {
2929
actions = [
3030
.markAsPaid,
3131
.issueRefund
32-
] + (booking.isOrderValid ? [.viewOrder] : [])
32+
] + (booking.hasAssociatedOrder ? [.viewOrder] : [])
3333
}
3434
}
3535
}

0 commit comments

Comments
 (0)