diff --git a/app/src/main/java/com/aurora/store/view/ui/splash/SplashFragment.kt b/app/src/main/java/com/aurora/store/view/ui/splash/SplashFragment.kt index 93cdf6568..e8c5c437c 100644 --- a/app/src/main/java/com/aurora/store/view/ui/splash/SplashFragment.kt +++ b/app/src/main/java/com/aurora/store/view/ui/splash/SplashFragment.kt @@ -39,8 +39,7 @@ import com.aurora.store.viewmodel.auth.AuthViewModel class SplashFragment : BaseFragment(R.layout.fragment_splash) { private var _binding: FragmentSplashBinding? = null - private val binding: FragmentSplashBinding - get() = _binding!! + private val binding get() = _binding!! private val viewModel: AuthViewModel by activityViewModels() @@ -48,6 +47,13 @@ class SplashFragment : BaseFragment(R.layout.fragment_splash) { super.onViewCreated(view, savedInstanceState) _binding = FragmentSplashBinding.bind(view) + if (!Preferences.getBoolean(requireContext(), PREFERENCE_INTRO)) { + findNavController().navigate( + SplashFragmentDirections.actionSplashFragmentToOnboardingFragment() + ) + return + } + binding.imgIcon.load(R.mipmap.ic_launcher) { transformations(RoundedCornersTransformation(32F)) } @@ -72,12 +78,6 @@ class SplashFragment : BaseFragment(R.layout.fragment_splash) { } } - if (!Preferences.getBoolean(requireContext(), PREFERENCE_INTRO)) { - findNavController().navigate( - SplashFragmentDirections.actionSplashFragmentToOnboardingFragment() - ) - } - attachActions() //Initial status