Fix missing appbar when statistics are loading

This commit is contained in:
arkon 2023-05-12 18:13:07 -04:00
parent ce81b76150
commit 8fae92034e

View File

@ -24,11 +24,6 @@ class StatsScreen : Screen {
val screenModel = rememberScreenModel { StatsScreenModel() } val screenModel = rememberScreenModel { StatsScreenModel() }
val state by screenModel.state.collectAsState() val state by screenModel.state.collectAsState()
if (state is StatsScreenState.Loading) {
LoadingScreen()
return
}
Scaffold( Scaffold(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
@ -38,6 +33,11 @@ class StatsScreen : Screen {
) )
}, },
) { paddingValues -> ) { paddingValues ->
if (state is StatsScreenState.Loading) {
LoadingScreen()
return@Scaffold
}
StatsScreenContent( StatsScreenContent(
state = state as StatsScreenState.Success, state = state as StatsScreenState.Success,
paddingValues = paddingValues, paddingValues = paddingValues,