diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/App.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/App.kt index 55458b0..5826e26 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/App.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/App.kt @@ -46,6 +46,8 @@ fun App() { val drawerState = DI.uiState.drawerState.collectAsState().value + val snackbarHostState = remember { SnackbarHostState() } + val coroutineScope = rememberCoroutineScope() coroutineScope.launch { @@ -55,7 +57,7 @@ fun App() { MaterialTheme(colors = colors, typography = typography) { Scaffold( - scaffoldState = rememberScaffoldState(drawerState), + scaffoldState = rememberScaffoldState(drawerState, snackbarHostState), bottomBar = { BottomBar() }, backgroundColor = Colors.Zinc100, floatingActionButton = { @@ -70,8 +72,6 @@ fun App() { drawerContent = { SideMenuContent() }, drawerBackgroundColor = Colors.DrawerContentBackground, snackbarHost = { snackbarHostState -> - StateHandler(uiState, snackbarHostState) - SnackbarHost( hostState = snackbarHostState ) { data -> @@ -93,6 +93,8 @@ fun App() { Column(Modifier.fillMaxSize().padding(scaffoldPadding), horizontalAlignment = Alignment.CenterHorizontally) { TransactionsList(uiState, uiSettings) } + + StateHandler(uiState, snackbarHostState) } } } \ No newline at end of file