2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

For #4436: Dismiss onboarding before navigating away from home (#4801)

This commit is contained in:
(´⌣`ʃƪ) 2019-08-20 10:56:28 -07:00 committed by Sawyer Blatz
parent 33f3b14c29
commit c076cc85f9

View File

@ -518,12 +518,19 @@ class HomeFragment : Fragment(), AccountObserver {
homeViewModel.motionLayoutProgress = homeLayout?.progress ?: 0F
}
private fun hideOnboardingIfNeeded() {
if (!onboarding.userHasBeenOnboarded()) {
onboarding.finish()
emitModeChanges()
}
}
private fun setupHomeMenu() {
homeMenu = HomeMenu(requireContext()) {
when (it) {
HomeMenu.Item.Settings -> {
invokePendingDeleteJobs()
onboarding.finish()
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToSettingsFragment()
@ -531,7 +538,7 @@ class HomeFragment : Fragment(), AccountObserver {
}
HomeMenu.Item.Library -> {
invokePendingDeleteJobs()
onboarding.finish()
hideOnboardingIfNeeded()
nav(
R.id.homeFragment,
HomeFragmentDirections.actionHomeFragmentToLibraryFragment()
@ -539,10 +546,7 @@ class HomeFragment : Fragment(), AccountObserver {
}
HomeMenu.Item.Help -> {
invokePendingDeleteJobs()
if (!onboarding.userHasBeenOnboarded()) {
onboarding.finish()
emitModeChanges()
}
hideOnboardingIfNeeded()
(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = SupportUtils.getSumoURLForTopic(
context!!,