Auth: load auth on app start and fix storage when token is null to prevent intermittent logged-out state
This commit is contained in:
@@ -174,8 +174,14 @@ fun KlottrAppShell(
|
||||
val currentLoc = locService.location.collectAsState(initial = null)
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
// Säkerställ att auth återställs från plattforms-lagring vid uppstart
|
||||
LaunchedEffect(Unit) {
|
||||
app.klottr.util.AuthShared.loadFromStorage()
|
||||
}
|
||||
|
||||
|
||||
// Inloggning
|
||||
val loggedIn by AuthShared.loggedIn.collectAsState(initial = false)
|
||||
val loggedIn by AuthShared.loggedIn.collectAsState(initial = app.klottr.util.AuthShared.loggedIn.value)
|
||||
|
||||
// Initiera SQLDelight-databasen med hjälp av DatabaseFactory.
|
||||
val db = remember {
|
||||
|
||||
Reference in New Issue
Block a user