fix: close both message context sheets smoothly

Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
Infi 2023-06-15 16:11:44 +02:00
parent 7377d540cd
commit 5db3d6f401
1 changed files with 13 additions and 0 deletions

View File

@ -100,6 +100,7 @@ fun MessageContextSheet(
) { ) {
if (message.content.isNullOrEmpty()) { if (message.content.isNullOrEmpty()) {
coroutineScope.launch { coroutineScope.launch {
shareSheetState.hide()
onHideSheet() onHideSheet()
Toast.makeText( Toast.makeText(
context, context,
@ -116,6 +117,9 @@ fun MessageContextSheet(
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
).show() ).show()
coroutineScope.launch {
shareSheetState.hide()
}
coroutineScope.launch { coroutineScope.launch {
clipboardManager.setText(AnnotatedString(message.content)) clipboardManager.setText(AnnotatedString(message.content))
onHideSheet() onHideSheet()
@ -144,6 +148,9 @@ fun MessageContextSheet(
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
).show() ).show()
coroutineScope.launch {
shareSheetState.hide()
}
coroutineScope.launch { coroutineScope.launch {
onHideSheet() onHideSheet()
} }
@ -164,6 +171,9 @@ fun MessageContextSheet(
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
).show() ).show()
coroutineScope.launch {
shareSheetState.hide()
}
coroutineScope.launch { coroutineScope.launch {
onHideSheet() onHideSheet()
} }
@ -193,6 +203,9 @@ fun MessageContextSheet(
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
).show() ).show()
coroutineScope.launch {
shareSheetState.hide()
}
coroutineScope.launch { coroutineScope.launch {
onHideSheet() onHideSheet()
} }