@@ -43,8 +43,6 @@ final class HubMenuViewModel: ObservableObject {
4343
4444 @Published var showingReviewDetail = false
4545
46- @Published var reviewsNotificationBadgeCount = 0
47-
4846 private var productReviewFromNoteParcel : ProductReviewFromNoteParcel ?
4947
5048 private var storePickerCoordinator : StorePickerCoordinator ?
@@ -59,8 +57,6 @@ final class HubMenuViewModel: ObservableObject {
5957 menuElements. append ( . coupons)
6058 }
6159 observeSiteForUIUpdates ( )
62- startListeningToReviewsBadgeUpdates ( )
63- loadReviewsNotificationCountAndUpdateBadge ( )
6460 }
6561
6662 /// Present the `StorePickerViewController` using the `StorePickerCoordinator`, passing the navigation controller from the entry point.
@@ -87,38 +83,12 @@ final class HubMenuViewModel: ObservableObject {
8783 }
8884
8985 private func observeSiteForUIUpdates( ) {
90- ServiceLocator . stores. site. sink { [ weak self ] site in
91- self ? . loadReviewsNotificationCountAndUpdateBadge ( )
86+ ServiceLocator . stores. site. sink { site in
87+ // This will be useful in the future for updating some info of the screen depending on the store site info
9288 } . store ( in: & cancellables)
9389 }
9490}
9591
96- // MARK: - Hub Menu Badges Updates
97- //
98- private extension HubMenuViewModel {
99-
100- /// Setup: KVO Hooks.
101- ///
102- func startListeningToReviewsBadgeUpdates( ) {
103- NotificationCenter . default. addObserver ( self ,
104- selector: #selector( loadReviewsNotificationCountAndUpdateBadge) ,
105- name: . reviewsBadgeReloadRequired,
106- object: nil )
107- }
108-
109- @objc func loadReviewsNotificationCountAndUpdateBadge( ) {
110- let stores : StoresManager = ServiceLocator . stores
111- guard let siteID = stores. sessionManager. defaultStoreID else {
112- return
113- }
114-
115- let action = NotificationCountAction . load ( siteID: siteID, type: . kind( . comment) ) { [ weak self] count in
116- self ? . reviewsNotificationBadgeCount = count
117- }
118- stores. dispatch ( action)
119- }
120- }
121-
12292extension HubMenuViewModel {
12393 enum Menu : CaseIterable {
12494 case woocommerceAdmin
0 commit comments