diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardViewModelSlice.kt index d3d7b4f8a09e..51979ee6ddb4 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardViewModelSlice.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/CardViewModelSlice.kt @@ -113,10 +113,6 @@ class CardViewModelSlice @Inject constructor( val refresh = merge( _refresh, - pagesCardViewModelSlice.refresh, - todaysStatsViewModelSlice.refresh, - postsCardViewModelSlice.refresh, - activityLogCardViewModelSlice.refresh, dynamicCardsViewModelSlice.refresh, ) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt index 3cb2354f080c..e44166b77174 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/activity/ActivityLogCardViewModelSlice.kt @@ -28,9 +28,6 @@ class ActivityLogCardViewModelSlice @Inject constructor( private val _onNavigation = MutableLiveData>() val onNavigation = _onNavigation - private val _refresh = MutableLiveData>() - val refresh = _refresh - fun buildCard(activityCardModel: CardModel.ActivityCardModel?) { _uiModel.postValue(activityCardBuilder.build(getActivityLogCardBuilderParams(activityCardModel))) } @@ -68,7 +65,7 @@ class ActivityLogCardViewModelSlice @Inject constructor( appPrefsWrapper.setShouldHideActivityDashboardCard( requireNotNull(selectedSiteRepository.getSelectedSite()).siteId, true ) - _refresh.postValue(Event(true)) + _uiModel.value = null } private fun onActivityCardAllActivityItemClick() { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/pages/PagesCardViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/pages/PagesCardViewModelSlice.kt index 816e4fc72a2f..35cc820f78fe 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/pages/PagesCardViewModelSlice.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/pages/PagesCardViewModelSlice.kt @@ -24,9 +24,6 @@ class PagesCardViewModelSlice @Inject constructor( private val _onNavigation = MutableLiveData>() val onNavigation = _onNavigation - private val _refresh = MutableLiveData>() - val refresh = _refresh - fun buildCard(pagesCardModel: PagesCardModel?) { _uiModel.postValue( pagesCardBuilder.build(getPagesCardBuilderParams(pagesCardModel)) @@ -61,7 +58,7 @@ class PagesCardViewModelSlice @Inject constructor( private fun onPagesCardHideThisCardClick() { cardsTracker.trackCardMoreMenuItemClicked(CardsTracker.Type.PAGES.label, PagesMenuItemType.HIDE_THIS.label) appPrefsWrapper.setShouldHidePagesDashboardCard(selectedSiteRepository.getSelectedSite()!!.siteId, true) - _refresh.postValue(Event(true)) + _uiModel.value = null } private fun onPagesItemClick(params: PagesCardBuilderParams.PagesItemClickParams) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/posts/PostsCardViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/posts/PostsCardViewModelSlice.kt index 104766119393..4bbc3ccfb0fd 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/posts/PostsCardViewModelSlice.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/posts/PostsCardViewModelSlice.kt @@ -25,9 +25,6 @@ class PostsCardViewModelSlice @Inject constructor( private val _onNavigation = MutableLiveData>() val onNavigation = _onNavigation - private val _refresh = MutableLiveData>() - val refresh = _refresh - fun buildPostCard(postsCardModel: PostsCardModel?) { _uiModel.postValue(postCardBuilder.build(getPostsCardBuilderParams(postsCardModel))) } @@ -58,7 +55,7 @@ class PostsCardViewModelSlice @Inject constructor( postCardType.name, true ) - refresh.postValue(Event(true)) + _uiModel.postValue(null) } private fun onViewPostsMenuItemClick(postCardType: PostCardType) { diff --git a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsViewModelSlice.kt b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsViewModelSlice.kt index 28bad0840fe5..0eb21a7bba74 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsViewModelSlice.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/dashboard/todaysstats/TodaysStatsViewModelSlice.kt @@ -26,10 +26,6 @@ class TodaysStatsViewModelSlice @Inject constructor( private val _onNavigation = MutableLiveData>() val onNavigation = _onNavigation - private val _refresh = MutableLiveData>() - val refresh = _refresh - - fun buildTodaysStatsCard(todaysStatsCardModel: TodaysStatsCardModel?) { _uiModel.postValue(todaysStatsCardBuilder.build(getTodaysStatsBuilderParams(todaysStatsCardModel))) } @@ -78,7 +74,7 @@ class TodaysStatsViewModelSlice @Inject constructor( TodaysStatsMenuItemType.HIDE_THIS.label ) appPrefsWrapper.setShouldHideTodaysStatsDashboardCard(selectedSiteRepository.getSelectedSite()!!.siteId, true) - _refresh.postValue(Event(true)) + _uiModel.value = null } private fun onViewStatsMenuItemClick() {