mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Show a Message not found placeholder when a replied to message cannot be loaded
When the replied to event could not be fetched, the reply preview rendered the raw SDK error string in critical styling, and tapping it emitted a focus request that could never succeed, so the user got a dead end dialog. Render the localised error_message_not_found string in the neutral italic style already used for redacted and undecryptable replies, and drop the click handler for that case. The existing key is reused rather than adding a new one; a "you do not have access" wording was rejected because this state covers any failure to load the event, not only a permission problem.
This commit is contained in:
+4
-4
@@ -77,7 +77,7 @@ fun InReplyToView(
|
||||
else -> ReplyToLoadingContent(modifier = modifier)
|
||||
}
|
||||
is InReplyToDetails.Error ->
|
||||
ReplyToErrorContent(data = inReplyTo, maxLines = maxLines, modifier = modifier)
|
||||
ReplyToErrorContent(maxLines = maxLines, modifier = modifier)
|
||||
is InReplyToDetails.Loading ->
|
||||
ReplyToLoadingContent(modifier = modifier)
|
||||
}
|
||||
@@ -150,7 +150,6 @@ private fun ReplyToLoadingContent(
|
||||
|
||||
@Composable
|
||||
private fun ReplyToErrorContent(
|
||||
data: InReplyToDetails.Error,
|
||||
maxLines: Int,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
@@ -161,9 +160,10 @@ private fun ReplyToErrorContent(
|
||||
.padding(paddings)
|
||||
) {
|
||||
Text(
|
||||
text = data.message,
|
||||
text = stringResource(id = CommonStrings.error_message_not_found),
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
color = ElementTheme.colors.textCriticalPrimary,
|
||||
fontStyle = FontStyle.Italic,
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
maxLines = maxLines,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user