From 62a2c7a51a58bbfb992565868da873ccbc65d682 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 20 Nov 2019 16:26:06 -0700 Subject: [PATCH] Re-add encryption warning to widget permission prompt --- src/components/views/elements/AppPermission.js | 5 ++++- src/components/views/elements/AppTile.js | 2 ++ src/i18n/strings/en_EN.json | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/AppPermission.js b/src/components/views/elements/AppPermission.js index 422427d4c4..c514dbc950 100644 --- a/src/components/views/elements/AppPermission.js +++ b/src/components/views/elements/AppPermission.js @@ -30,6 +30,7 @@ export default class AppPermission extends React.Component { creatorUserId: PropTypes.string.isRequired, roomId: PropTypes.string.isRequired, onPermissionGranted: PropTypes.func.isRequired, + isRoomEncrypted: PropTypes.bool, }; static defaultProps = { @@ -114,6 +115,8 @@ export default class AppPermission extends React.Component { : _t("Using this widget may share data with %(widgetDomain)s.", {widgetDomain: this.state.widgetDomain}, {helpIcon: () => warningTooltip}); + const encryptionWarning = this.props.isRoomEncrypted ? _t("Widgets are not encrypted.") : null; + return (
@@ -128,7 +131,7 @@ export default class AppPermission extends React.Component { {warning}
- {_t("This widget may use cookies.")} + {_t("This widget may use cookies.")} {encryptionWarning}
diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index db5978c792..4b0079098a 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -585,12 +585,14 @@ export default class AppTile extends React.Component {
); if (!this.state.hasPermissionToLoad) { + const isEncrypted = MatrixClientPeg.get().isRoomEncrypted(this.props.room.roomId); appTileBody = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7709a4a398..8b71a1e182 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1195,6 +1195,7 @@ "Widget ID": "Widget ID", "Using this widget may share data with %(widgetDomain)s & your Integration Manager.": "Using this widget may share data with %(widgetDomain)s & your Integration Manager.", "Using this widget may share data with %(widgetDomain)s.": "Using this widget may share data with %(widgetDomain)s.", + "Widgets are not encrypted.": "Widgets are not encrypted.", "Widget added by": "Widget added by", "This widget may use cookies.": "This widget may use cookies.", "Delete Widget": "Delete Widget",