@@ -7,6 +7,7 @@ import kotlinx.coroutines.launch
77import org.wordpress.android.R
88import org.wordpress.android.fluxc.model.SiteModel
99import org.wordpress.android.fluxc.store.SiteStore
10+ import org.wordpress.android.fluxc.utils.AppLogWrapper
1011import org.wordpress.android.ui.accounts.login.ApplicationPasswordLoginHelper
1112import org.wordpress.android.ui.mysite.MySiteCardAndItem
1213import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinksItem.QuickLinkItem
@@ -16,13 +17,15 @@ import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures
1617import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures.Feature
1718import org.wordpress.android.ui.utils.ListItemInteraction
1819import org.wordpress.android.ui.utils.UiString.UiStringRes
20+ import org.wordpress.android.util.AppLog
1921import org.wordpress.android.viewmodel.Event
2022import javax.inject.Inject
2123
2224class ApplicationPasswordViewModelSlice @Inject constructor(
2325 private val applicationPasswordLoginHelper : ApplicationPasswordLoginHelper ,
2426 private val siteStore : SiteStore ,
2527 private val experimentalFeatures : ExperimentalFeatures ,
28+ private val appLogWrapper : AppLogWrapper ,
2629) {
2730 lateinit var scope: CoroutineScope
2831
@@ -57,12 +60,14 @@ class ApplicationPasswordViewModelSlice @Inject constructor(
5760 val storedSite = siteStore.sites.firstOrNull { it.id == site.id }
5861 if (storedSite != null && ! applicationPasswordLoginHelper.siteHasBadCredentials(site)) {
5962 uiModelMutable.postValue(null )
63+ appLogWrapper.d(AppLog .T .MAIN , " WP_RS: Hiding card for ${site.url} - authenticated" )
6064 return @launch
6165 }
6266
6367 val authorizationUrlComplete = applicationPasswordLoginHelper.getAuthorizationUrlComplete(site.url)
6468 if (authorizationUrlComplete.isEmpty()) {
6569 uiModelMutable.postValue(null )
70+ appLogWrapper.d(AppLog .T .MAIN , " WP_RS: Hiding card for ${site.url} - bad discovery" )
6671 } else {
6772 showApplicationPasswordCreateCard(site)
6873 }
@@ -81,6 +86,7 @@ class ApplicationPasswordViewModelSlice @Inject constructor(
8186 )
8287 )
8388 )
89+ appLogWrapper.d(AppLog .T .MAIN , " WP_RS: Showing card for ${site.url} " )
8490 }
8591
8692
0 commit comments