Skip to content

Commit 9fa4d9d

Browse files
committed
feat(add-new-user)
1 parent 16f88e8 commit 9fa4d9d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

feature-add/src/main/java/com/hoc/flowmvi/ui/add/AddNewUserScreen.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import com.hoc.flowmvi.ui.theme.AppTheme
6161
import kotlinx.collections.immutable.persistentHashSetOf
6262
import kotlinx.coroutines.Dispatchers
6363
import kotlinx.coroutines.channels.Channel
64+
import kotlinx.coroutines.delay
6465
import kotlinx.coroutines.flow.collect
6566
import kotlinx.coroutines.flow.consumeAsFlow
6667
import 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
}

0 commit comments

Comments
 (0)