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:
parent
adc1813fd6
commit
a939f4ee8f
@ -6,7 +6,6 @@ package org.mozilla.fenix.shortcut
|
|||||||
|
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import mozilla.components.browser.session.Session
|
import mozilla.components.browser.session.Session
|
||||||
import mozilla.components.concept.engine.manifest.WebAppManifest
|
|
||||||
import mozilla.components.feature.pwa.WebAppUseCases
|
import mozilla.components.feature.pwa.WebAppUseCases
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
import org.mozilla.fenix.browser.BrowserFragmentDirections
|
||||||
@ -22,8 +21,8 @@ class PwaOnboardingObserver(
|
|||||||
private val webAppUseCases: WebAppUseCases
|
private val webAppUseCases: WebAppUseCases
|
||||||
) : Session.Observer {
|
) : Session.Observer {
|
||||||
|
|
||||||
override fun onWebAppManifestChanged(session: Session, manifest: WebAppManifest?) {
|
override fun onLoadingStateChanged(session: Session, loading: Boolean) {
|
||||||
if (webAppUseCases.isInstallable() && !settings.userKnowsAboutPwas) {
|
if (!loading && webAppUseCases.isInstallable() && !settings.userKnowsAboutPwas) {
|
||||||
settings.incrementVisitedInstallableCount()
|
settings.incrementVisitedInstallableCount()
|
||||||
if (settings.shouldShowPwaOnboarding) {
|
if (settings.shouldShowPwaOnboarding) {
|
||||||
val directions =
|
val directions =
|
||||||
|
Loading…
Reference in New Issue
Block a user