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
|
useProfile: Boolean = true
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
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) {
|
if (LocalInspectionMode.current) {
|
||||||
Spacer(
|
Spacer(
|
||||||
@@ -37,6 +36,8 @@ fun AvatarImage(
|
|||||||
.background(color = Color.Red, shape = CircleShape)
|
.background(color = Color.Red, shape = CircleShape)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
val state = recipient.live().liveData.map { AvatarImageState(NameUtil.getAbbreviation(it.getDisplayName(context)), it, AvatarHelper.getAvatarFileDetails(context, it.id)) }.observeAsState().value ?: return
|
||||||
|
|
||||||
AndroidView(
|
AndroidView(
|
||||||
factory = ::AvatarImageView,
|
factory = ::AvatarImageView,
|
||||||
modifier = modifier.background(color = Color.Transparent, shape = CircleShape)
|
modifier = modifier.background(color = Color.Transparent, shape = CircleShape)
|
||||||
|
|||||||
Reference in New Issue
Block a user