Skip to content

Commit 81e9c33

Browse files
committed
Rename Notice property and update documentation
1 parent 228f144 commit 81e9c33

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/AnalyticsHubView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct AnalyticsHubView: View {
110110
.task {
111111
await viewModel.updateData()
112112
}
113-
.onReceive(viewModel.$notice) { notice in
113+
.onReceive(viewModel.$dismissNotice) { notice in
114114
guard let notice else { return }
115115
dismissWithNotice(notice)
116116
}

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/AnalyticsHubViewModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ final class AnalyticsHubViewModel: ObservableObject {
4747
///
4848
@Published var timeRangeCard: AnalyticsTimeRangeCardViewModel
4949

50-
/// Defines a notice that should be shown after the view is dismissed.
50+
/// Defines a notice that, when set, dismisses the view and is then displayed.
5151
/// Defaults to `nil`.
5252
///
53-
@Published var notice: Notice?
53+
@Published var dismissNotice: Notice?
5454

5555
// MARK: Private data
5656

@@ -77,7 +77,7 @@ final class AnalyticsHubViewModel: ObservableObject {
7777
do {
7878
try await retrieveOrderStats()
7979
} catch is AnalyticsHubTimeRangeSelection.TimeRangeGeneratorError {
80-
notice = Notice(title: Localization.timeRangeGeneratorError, feedbackType: .error)
80+
dismissNotice = Notice(title: Localization.timeRangeGeneratorError, feedbackType: .error)
8181
DDLogWarn("⚠️ Error selecting analytics time range: \(timeRangeSelectionType.description)")
8282
} catch {
8383
switchToErrorState()

0 commit comments

Comments
 (0)