fix: Fixed the home screen not being reset.

This commit is contained in:
HeCodes2Much
2024-05-23 20:41:27 +01:00
parent e53b2ea025
commit 80c9ccd163

View File

@@ -74,12 +74,14 @@ class MainActivity : AppCompatActivity() {
preferenceViewModel.setShowStatusBar(preferenceHelper.showStatusBar)
preferenceViewModel.showStatusBarLiveData.observe(this) {
if (it) appHelper.showStatusBar(this.window)
else appHelper.hideStatusBar(this.window) }
else appHelper.hideStatusBar(this.window)
}
}
private fun setupNavController() {
// Find the NavHostFragment
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.nav_host_fragment_content_main) as NavHostFragment
// Retrieve the NavController
val navController = navHostFragment.navController
@@ -113,6 +115,7 @@ class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
backToHomeScreen()
setupDataBase()
observeUI()
}