From b4e60af61f5e2c35028d9fffc63aeeb54b7c81b9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 3 Dec 2019 23:15:49 -0700 Subject: [PATCH] Appease the linter and de-dupe code --- src/components/views/rooms/EventTile.js | 31 +++++++++++-------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index efda6c6d44..fb0878b880 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -939,25 +939,20 @@ class E2ePadlock extends React.Component { const Tooltip = sdk.getComponent("elements.Tooltip"); tooltip = ; } - if (SettingsStore.getValue("alwaysShowEncryptionIcons")) { - return ( -
{tooltip}
- ); - } else { - return ( -
{tooltip}
- ); + + let classes = `mx_EventTile_e2eIcon mx_EventTile_e2eIcon_${this.props.icon}`; + if (!SettingsStore.getValue("alwaysShowEncryptionIcons")) { + classes += ' mx_EventTile_e2eIcon_hidden'; } + + return ( +
{tooltip}
+ ); } }