File tree Expand file tree Collapse file tree
flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ data class ConversationScreen(
9595 val navigator = LocalCodeNavigator .current
9696 val vm = getViewModel<ConversationViewModel >()
9797
98+ val keyboardVisible by keyboardAsState()
99+ val keyboard = LocalSoftwareKeyboardController .current
100+ val composeScope = rememberCoroutineScope()
101+
98102 LaunchedEffect (chatId) {
99103 if (chatId != null ) {
100104 vm.dispatchEvent(
@@ -156,9 +160,7 @@ data class ConversationScreen(
156160
157161 val state by vm.stateFlow.collectAsState()
158162 val messages = vm.messages.collectAsLazyPagingItems()
159- val keyboardVisible by keyboardAsState()
160- val keyboard = LocalSoftwareKeyboardController .current
161- val composeScope = rememberCoroutineScope()
163+
162164
163165 val goBack = {
164166 composeScope.launch {
@@ -188,14 +190,21 @@ data class ConversationScreen(
188190 }
189191
190192 val openRoomDetails = {
191- navigator.push(
192- ScreenRegistry .get(
193- NavScreenProvider .Chat .Info (
194- state.roomInfoArgs
193+ composeScope.launch {
194+ if (keyboardVisible) {
195+ keyboard?.hide()
196+ delay(500 )
197+ }
198+ navigator.push(
199+ ScreenRegistry .get(
200+ NavScreenProvider .Chat .Info (
201+ state.roomInfoArgs
202+ )
195203 )
196204 )
197- )
205+ }
198206 }
207+
199208 Column {
200209 AppBarWithTitle (
201210 title = {
You can’t perform that action at this time.
0 commit comments