From 3426ff307cfbd46dc020b1d7d4180f70e5fa538c Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 15 Mar 2023 13:58:09 -0400 Subject: [PATCH] Makes sure onClick and onLongClick are null when their counterparts are as well. --- .../vitorpamplona/amethyst/ui/note/NoteCompose.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index 3f4b75855..83d558f77 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -707,7 +707,6 @@ fun UserPicture( } } -@OptIn(ExperimentalFoundationApi::class) @Composable fun UserPicture( baseUser: User, @@ -731,16 +730,8 @@ fun UserPicture( showFollowingMark = showFollowingMark, size = size, modifier = modifier, - onClick = { - if (onClick != null) { - onClick(user) - } - }, - onLongClick = { - if (onLongClick != null) { - onLongClick(user) - } - } + onClick = onClick?.let { { it(user) } }, + onLongClick = onLongClick?.let { { it(user) } } ) }