mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-09-29 16:30:49 +00:00
Avoids null model errors that might be delaying some of the rendering.
This commit is contained in:
parent
6cbee81e72
commit
579465ac6c
@ -1,5 +1,6 @@
|
|||||||
package com.vitorpamplona.amethyst.ui.components
|
package com.vitorpamplona.amethyst.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
@ -64,6 +65,7 @@ fun RobohashFallbackAsyncImage(
|
|||||||
model = Robohash.imageRequest(context, robot)
|
model = Robohash.imageRequest(context, robot)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (model != null) {
|
||||||
AsyncImage(
|
AsyncImage(
|
||||||
model = model,
|
model = model,
|
||||||
contentDescription = contentDescription,
|
contentDescription = contentDescription,
|
||||||
@ -77,6 +79,16 @@ fun RobohashFallbackAsyncImage(
|
|||||||
colorFilter = colorFilter,
|
colorFilter = colorFilter,
|
||||||
filterQuality = filterQuality
|
filterQuality = filterQuality
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
Image(
|
||||||
|
painter = painter,
|
||||||
|
contentDescription = contentDescription,
|
||||||
|
modifier = modifier,
|
||||||
|
alignment = alignment,
|
||||||
|
contentScale = contentScale,
|
||||||
|
colorFilter = colorFilter
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
Loading…
Reference in New Issue
Block a user