Skip to content

Commit a4121fa

Browse files
committed
Switch to billing address data for booking header
1 parent ea1d402 commit a4121fa

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ private extension BookingDetailsViewModel {
176176

177177
@MainActor
178178
func updateHeader(with customer: Customer) {
179-
headerContent.update(with: customer)
179+
if let billingAddress = customer.billing {
180+
headerContent.update(with: billingAddress)
181+
}
180182
}
181183

182184
func insertCustomerSectionIfAbsent() {

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Foundation
22
import struct Yosemite.Booking
33
import struct Yosemite.Customer
4+
import struct Networking.Address
45

56
extension BookingDetailsViewModel {
67
final class HeaderContent: ObservableObject {
@@ -31,10 +32,10 @@ extension BookingDetailsViewModel {
3132
}
3233

3334
@MainActor
34-
func update(with customer: Customer) {
35+
func update(with address: Address) {
3536
let customerName = [
36-
customer.firstName,
37-
customer.lastName
37+
address.firstName,
38+
address.lastName
3839
]
3940
.compactMap { $0 }
4041
.filter { !$0.isEmpty }

0 commit comments

Comments
 (0)