Skip to content

Commit 5e52593

Browse files
committed
fix(fc): remove post processing of room names on event
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent a61c064 commit 5e52593

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/info/ChatInfoViewModel.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import kotlinx.coroutines.flow.mapNotNull
2121
import kotlinx.coroutines.flow.onEach
2222
import xyz.flipchat.app.R
2323
import xyz.flipchat.app.data.RoomInfo
24-
import xyz.flipchat.app.features.chat.conversation.ConversationViewModel.Event
2524
import xyz.flipchat.app.features.login.register.onResult
2625
import xyz.flipchat.app.util.IntentUtils
2726
import xyz.flipchat.chat.RoomController

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/name/RoomNameScreen.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,20 @@ data class RoomNameScreen(val roomId: ID, val customTitle: String) : Screen, Par
6565
val navigator = LocalCodeNavigator.current
6666
val keyboardIsVisible by keyboardAsState()
6767
val keyboard = LocalSoftwareKeyboardController.current
68+
val scope = rememberCoroutineScope()
6869

69-
70-
BackHandler {
71-
if (keyboardIsVisible) {
72-
keyboard?.hide()
73-
} else {
70+
val goBack = {
71+
scope.launch {
72+
if (keyboardIsVisible) {
73+
keyboard?.hide()
74+
delay(500)
75+
}
7476
navigator.pop()
7577
}
7678
}
79+
BackHandler {
80+
goBack()
81+
}
7782

7883
Column(
7984
modifier = Modifier
@@ -82,7 +87,7 @@ data class RoomNameScreen(val roomId: ID, val customTitle: String) : Screen, Par
8287
AppBarWithTitle(
8388
backButton = true,
8489
title = stringResource(R.string.action_changeRoomName),
85-
onBackIconClicked = { navigator.pop() },
90+
onBackIconClicked = { goBack() },
8691
)
8792

8893
val viewModel = getViewModel<RoomNameScreenViewModel>()

services/flipchat/sdk/src/main/kotlin/xyz/flipchat/controllers/ChatsController.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import xyz.flipchat.services.domain.model.chat.db.ConversationUpdate
3636
import xyz.flipchat.services.domain.model.query.QueryOptions
3737
import xyz.flipchat.services.extensions.titleOrFallback
3838
import xyz.flipchat.services.internal.data.mapper.ConversationMemberMapper
39+
import xyz.flipchat.services.internal.data.mapper.nullIfEmpty
3940
import xyz.flipchat.services.internal.network.repository.chat.ChatRepository
4041
import xyz.flipchat.services.internal.network.repository.messaging.MessagingRepository
4142
import xyz.flipchat.services.user.UserManager
@@ -108,11 +109,10 @@ class ChatsController @Inject constructor(
108109
db.conversationDao().updateMessagingFee(update.roomId, update.amount)
109110
}
110111
is ConversationUpdate.DisplayName -> {
111-
val conversation = db.conversationDao().findConversationRaw(update.roomId)?.copy(title = update.name)
112+
val conversation = db.conversationDao().findConversationRaw(update.roomId)
112113
if (conversation != null) {
113-
val newTitle = conversation.titleOrFallback(resources = resources)
114114
db.conversationDao()
115-
.setDisplayName(update.roomId, newTitle)
115+
.setDisplayName(update.roomId, update.name)
116116
}
117117
}
118118
is ConversationUpdate.LastActivity -> {

0 commit comments

Comments
 (0)