2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/12364 - Improve PWA onboarding timing logic

This commit is contained in:
ekager 2020-07-23 20:25:39 -04:00 committed by Emily Kager
parent adc1813fd6
commit a939f4ee8f

View File

@ -6,7 +6,6 @@ package org.mozilla.fenix.shortcut
import androidx.navigation.NavController
import mozilla.components.browser.session.Session
import mozilla.components.concept.engine.manifest.WebAppManifest
import mozilla.components.feature.pwa.WebAppUseCases
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserFragmentDirections
@ -22,8 +21,8 @@ class PwaOnboardingObserver(
private val webAppUseCases: WebAppUseCases
) : Session.Observer {
override fun onWebAppManifestChanged(session: Session, manifest: WebAppManifest?) {
if (webAppUseCases.isInstallable() && !settings.userKnowsAboutPwas) {
override fun onLoadingStateChanged(session: Session, loading: Boolean) {
if (!loading && webAppUseCases.isInstallable() && !settings.userKnowsAboutPwas) {
settings.incrementVisitedInstallableCount()
if (settings.shouldShowPwaOnboarding) {
val directions =