From d414127f8062ba998789cbea3b86fa3456de4fd2 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 3 Apr 2016 23:31:42 +0100 Subject: [PATCH] track whether widget should be hidden on the event, as well as persisting it in localStorage --- src/components/views/rooms/MessageContextMenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MessageContextMenu.js b/src/components/views/rooms/MessageContextMenu.js index 24948f74..0d162a82 100644 --- a/src/components/views/rooms/MessageContextMenu.js +++ b/src/components/views/rooms/MessageContextMenu.js @@ -71,8 +71,9 @@ module.exports = React.createClass({ // FIXME: factor this out with LinkPreviewWidget // FIXME: somehow propagate this to the EventTile such that it updates itself and realises the link has rematerialised global.localStorage.removeItem("hide_preview_" + this.props.mxEvent.getId()); - if (this.props.onFinished) this.props.onFinished(); } + this.props.mxEvent.widgetHidden = false; + if (this.props.onFinished) this.props.onFinished(); }, render: function() { @@ -116,7 +117,7 @@ module.exports = React.createClass({ if (global.localStorage) { - // FIXME: factor this out with LinkPreviewWidget + // FIXME: factor this out with LinkPreviewWidget if (global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()) === "1") { unhidePreviewButton = (