BugFix for blank screen when pressing the message button without any history of chats

This commit is contained in:
Vitor Pamplona
2023-08-13 17:38:44 -04:00
parent b12b81282c
commit 80f0b14c02
@@ -679,7 +679,7 @@ private fun ProfileHeader(
.height(Size35dp) .height(Size35dp)
.padding(bottom = 3.dp) .padding(bottom = 3.dp)
) { ) {
MessageButton(baseUser, nav) MessageButton(baseUser, accountViewModel, nav)
// No need for this button anymore // No need for this button anymore
// NPubCopyButton(baseUser) // NPubCopyButton(baseUser)
@@ -1538,7 +1538,7 @@ fun TabRelays(user: User, accountViewModel: AccountViewModel, nav: (String) -> U
} }
@Composable @Composable
private fun MessageButton(user: User, nav: (String) -> Unit) { private fun MessageButton(user: User, accountViewModel: AccountViewModel, nav: (String) -> Unit) {
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
Button( Button(
@@ -1548,7 +1548,7 @@ private fun MessageButton(user: User, nav: (String) -> Unit) {
onClick = { onClick = {
scope.launch(Dispatchers.IO) { scope.launch(Dispatchers.IO) {
val withKey = ChatroomKey(persistentSetOf(user.pubkeyHex)) val withKey = ChatroomKey(persistentSetOf(user.pubkeyHex))
user.createChatroom(withKey) accountViewModel.account.userProfile().createChatroom(withKey)
nav("Room/${withKey.hashCode()}") nav("Room/${withKey.hashCode()}")
} }
}, },