File tree Expand file tree Collapse file tree
WordPress/src/main/java/org/wordpress/android/ui/mysite/personalization Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org.wordpress.android.ui.mysite.personalization
22
3+ import androidx.lifecycle.LiveData
4+ import androidx.lifecycle.MutableLiveData
35import androidx.lifecycle.viewModelScope
46import dagger.hilt.android.lifecycle.HiltViewModel
57import kotlinx.coroutines.CoroutineDispatcher
@@ -27,9 +29,14 @@ class PersonalizationViewModel @Inject constructor(
2729 }
2830
2931 fun start () {
30- val siteId = selectedSiteRepository.getSelectedSite()!! .siteId
31- dashboardCardPersonalizationViewModelSlice.start(siteId)
32- shortcutsPersonalizationViewModelSlice.start(selectedSiteRepository.getSelectedSite()!! )
32+ val site = selectedSiteRepository.getSelectedSite()
33+ if (site == null ) {
34+ // todo pass a state to the ui
35+ return
36+ }
37+
38+ dashboardCardPersonalizationViewModelSlice.start(site.siteId)
39+ shortcutsPersonalizationViewModelSlice.start(site)
3340 }
3441
3542 fun onCardToggled (cardType : CardType , enabled : Boolean ) {
You can’t perform that action at this time.
0 commit comments