diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/newchat/NewChatSheet.kt b/apps/android/app/src/main/java/chat/simplex/app/views/newchat/NewChatSheet.kt index db23d0d1bc..62cec2073c 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/newchat/NewChatSheet.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/newchat/NewChatSheet.kt @@ -1,5 +1,6 @@ package chat.simplex.app.views.newchat +import androidx.activity.compose.BackHandler import androidx.compose.foundation.* import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape @@ -24,6 +25,7 @@ import chat.simplex.app.views.helpers.ModalManager @Composable fun NewChatSheet(chatModel: ChatModel, newChatCtrl: ScaffoldController) { + if (newChatCtrl.expanded.value) BackHandler { newChatCtrl.collapse() } NewChatSheetLayout( addContact = { newChatCtrl.collapse() diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/newchat/PasteToConnect.kt b/apps/android/app/src/main/java/chat/simplex/app/views/newchat/PasteToConnect.kt index ccf32033c6..2b0f8bd0b7 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/newchat/PasteToConnect.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/newchat/PasteToConnect.kt @@ -32,7 +32,7 @@ fun PasteToConnectView(chatModel: ChatModel) { chatModel.incognito.value, connectionLink = connectionLink, pasteFromClipboard = { - connectionLink.value = clipboard?.primaryClip?.getItemAt(0)?.coerceToText(context) as String + connectionLink.value = clipboard?.primaryClip?.getItemAt(0)?.coerceToText(context) as? String ?: return@PasteToConnectLayout }, connectViaLink = { connReqUri -> try {