Fix being unable to switch users

StartupActivity now checks if the action in the launch intent is ACTION_MAIN (opened from launcher)
This commit is contained in:
Niels van Velzen
2021-08-05 19:14:53 +02:00
parent ad89c30b79
commit 8f1584d648

View File

@@ -73,8 +73,10 @@ class StartupActivity : FragmentActivity(R.layout.fragment_content_view) {
serverRepository.migrateLegacyCredentials()
}
// Always restore the default session in case the "default user" changed
sessionRepository.restoreDefaultSession()
// Always restore the default session when starting from launcher
if (intent.action == Intent.ACTION_MAIN) {
sessionRepository.restoreDefaultSession()
}
// Ensure basic permissions
networkPermissionsRequester.launch(arrayOf(Manifest.permission.INTERNET, Manifest.permission.ACCESS_NETWORK_STATE))