mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:30:43 +00:00
Compact code.
This commit is contained in:
+5
-6
@@ -36,15 +36,14 @@ fun TimelineItemEncryptedView(
|
|||||||
onContentLayoutChanged: (ContentAvoidingLayoutData) -> Unit,
|
onContentLayoutChanged: (ContentAvoidingLayoutData) -> Unit,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
var text = stringResource(id = CommonStrings.common_waiting_for_decryption_key)
|
val (textId, iconId) = if (content.data is UnableToDecryptContent.Data.MegolmV1AesSha2 &&
|
||||||
var iconId = CompoundDrawables.ic_compound_time
|
|
||||||
if (content.data is UnableToDecryptContent.Data.MegolmV1AesSha2 &&
|
|
||||||
content.data.utdCause == UtdCause.Membership) {
|
content.data.utdCause == UtdCause.Membership) {
|
||||||
text = stringResource(id = CommonStrings.common_unable_to_decrypt_no_access)
|
(CommonStrings.common_unable_to_decrypt_no_access to CompoundDrawables.ic_compound_block)
|
||||||
iconId = CompoundDrawables.ic_compound_block
|
} else {
|
||||||
|
(CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time)
|
||||||
}
|
}
|
||||||
TimelineItemInformativeView(
|
TimelineItemInformativeView(
|
||||||
text = text,
|
text = stringResource(id = textId),
|
||||||
iconDescription = stringResource(id = CommonStrings.dialog_title_warning),
|
iconDescription = stringResource(id = CommonStrings.dialog_title_warning),
|
||||||
iconResourceId = iconId,
|
iconResourceId = iconId,
|
||||||
onContentLayoutChanged = onContentLayoutChanged,
|
onContentLayoutChanged = onContentLayoutChanged,
|
||||||
|
|||||||
Reference in New Issue
Block a user