File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
feature-add/src/main/java/com/hoc/flowmvi/ui/add Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import com.hoc.flowmvi.ui.theme.AppTheme
6161import kotlinx.collections.immutable.persistentHashSetOf
6262import kotlinx.coroutines.Dispatchers
6363import kotlinx.coroutines.channels.Channel
64+ import kotlinx.coroutines.delay
6465import kotlinx.coroutines.flow.collect
6566import kotlinx.coroutines.flow.consumeAsFlow
6667import kotlinx.coroutines.flow.onEach
@@ -75,14 +76,16 @@ internal fun AddNewUserRoute(
7576 modifier : Modifier = Modifier ,
7677 viewModel : AddVM = hiltViewModel(),
7778) {
79+ val currentOnBackClick by rememberUpdatedState(onBackClick)
80+
7881 val title = stringResource(id = R .string.add_new_user)
7982 val colors = TopAppBarDefaults .centerAlignedTopAppBarColors()
8083 val appBarState = remember(colors) {
8184 AppBarState (
8285 title = title,
8386 actions = {},
8487 navigationIcon = {
85- IconButton (onClick = onBackClick ) {
88+ IconButton (onClick = { currentOnBackClick() } ) {
8689 Icon (
8790 imageVector = Icons .Filled .ArrowBack ,
8891 contentDescription = " Back"
@@ -128,6 +131,10 @@ internal fun AddNewUserRoute(
128131 context.getString(R .string.add_user_success)
129132 )
130133 }
134+ scope.launch {
135+ delay(200 )
136+ currentOnBackClick()
137+ }
131138 }
132139 }
133140 }
You can’t perform that action at this time.
0 commit comments