Skip to content

Commit bb662c4

Browse files
committed
Present status update error notice
1 parent cdfa206 commit bb662c4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class BookingDetailsViewModel: ObservableObject {
2727

2828
@Published private(set) var navigationTitle = ""
2929
@Published private(set) var sections: [Section] = []
30+
@Published var notice: Notice?
3031

3132
var bookingAttendanceStatus: BookingAttendanceStatus {
3233
booking.attendanceStatus
@@ -243,12 +244,12 @@ extension BookingDetailsViewModel {
243244
}
244245

245246
private func displayAttendanceStatusUpdatedErrorNotice(status: BookingAttendanceStatus) {
246-
let title = String.localizedStringWithFormat(
247+
let text = String.localizedStringWithFormat(
247248
Localization.bookingAttendanceStatusUpdateFailedMessage,
248249
booking.bookingID
249250
)
250-
let notice = Notice(
251-
title: title,
251+
self.notice = Notice(
252+
message: text,
252253
feedbackType: .error,
253254
actionTitle: Localization.retryActionTitle
254255
) { [weak self] in
@@ -258,8 +259,6 @@ extension BookingDetailsViewModel {
258259

259260
updateAttendanceStatus(to: status)
260261
}
261-
262-
ServiceLocator.noticePresenter.enqueue(notice: notice)
263262
}
264263
}
265264

WooCommerce/Classes/ViewRelated/Bookings/Booking Details/BookingDetailsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ struct BookingDetailsView: View {
103103
Text(viewModel.cancellationAlertMessage)
104104
}
105105
.notice($notice)
106+
.notice($viewModel.notice)
106107
}
107108
}
108109

0 commit comments

Comments
 (0)