From b95956a3a446e79738d2781a912ae0ff6f5b0af7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 19 Aug 2020 10:38:26 +0100 Subject: [PATCH] Clear url previews if they all get edited out of the event --- src/components/views/messages/TextualBody.js | 2 ++ src/components/views/rooms/LinkPreviewWidget.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 5f9e5e7db1..df72398b1c 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -172,6 +172,8 @@ export default createReactClass({ const hidden = global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()); this.setState({ widgetHidden: hidden }); } + } else if (this.state.links.length) { + this.setState({ links: [] }); } } }, diff --git a/src/components/views/rooms/LinkPreviewWidget.js b/src/components/views/rooms/LinkPreviewWidget.js index 1fe70dc61c..d1c1ce04f9 100644 --- a/src/components/views/rooms/LinkPreviewWidget.js +++ b/src/components/views/rooms/LinkPreviewWidget.js @@ -134,7 +134,7 @@ export default createReactClass({ const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); return ( -
+
{ img }
{ p["og:title"] }