From 6edbb82591ac6b7f27b122d44930ed452822176f Mon Sep 17 00:00:00 2001 From: ekager Date: Thu, 23 Jul 2020 20:25:39 -0400 Subject: [PATCH] For #12364 - Improve PWA onboarding timing logic --- .../java/org/mozilla/fenix/shortcut/PwaOnboardingObserver.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/shortcut/PwaOnboardingObserver.kt b/app/src/main/java/org/mozilla/fenix/shortcut/PwaOnboardingObserver.kt index 5e312df86..10dd4132f 100644 --- a/app/src/main/java/org/mozilla/fenix/shortcut/PwaOnboardingObserver.kt +++ b/app/src/main/java/org/mozilla/fenix/shortcut/PwaOnboardingObserver.kt @@ -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 =