mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Move live state into if statement for AvatarImage.
This commit is contained in:
@@ -29,7 +29,6 @@ fun AvatarImage(
|
||||
useProfile: Boolean = true
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val state = recipient.live().liveData.map { AvatarImageState(NameUtil.getAbbreviation(it.getDisplayName(context)), it, AvatarHelper.getAvatarFileDetails(context, it.id)) }.observeAsState().value ?: return
|
||||
|
||||
if (LocalInspectionMode.current) {
|
||||
Spacer(
|
||||
@@ -37,6 +36,8 @@ fun AvatarImage(
|
||||
.background(color = Color.Red, shape = CircleShape)
|
||||
)
|
||||
} else {
|
||||
val state = recipient.live().liveData.map { AvatarImageState(NameUtil.getAbbreviation(it.getDisplayName(context)), it, AvatarHelper.getAvatarFileDetails(context, it.id)) }.observeAsState().value ?: return
|
||||
|
||||
AndroidView(
|
||||
factory = ::AvatarImageView,
|
||||
modifier = modifier.background(color = Color.Transparent, shape = CircleShape)
|
||||
|
||||
Reference in New Issue
Block a user