fix(common): prevent link metadata resolution from creating fatal errors

This commit is contained in:
Harsh Shandilya 2022-10-18 12:08:49 +05:30
parent a4be2d4bf2
commit 15dc9c3dc7
No known key found for this signature in database

View file

@ -58,7 +58,8 @@ fun CommentsHeader(
produceState(
initialValue = LinkMetadata(postDetails.url, null, null),
) {
value = postActions.getLinkMetadata(postDetails.url)
runCatching { postActions.getLinkMetadata(postDetails.url) }
.onSuccess { metadata -> value = metadata }
}
Surface(color = MaterialTheme.colorScheme.background, modifier = modifier) {