diff --git a/src/components/views/rooms/MessageContextMenu.js b/src/components/views/rooms/MessageContextMenu.js index a0a3f1cf..24948f74 100644 --- a/src/components/views/rooms/MessageContextMenu.js +++ b/src/components/views/rooms/MessageContextMenu.js @@ -66,6 +66,15 @@ module.exports = React.createClass({ if (this.props.onFinished) this.props.onFinished(); }, + onUnhidePreviewClick: function() { + if (global.localStorage) { + // 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(); + } + }, + render: function() { var eventStatus = this.props.mxEvent.status; var resendButton; @@ -73,6 +82,7 @@ module.exports = React.createClass({ var redactButton; var cancelButton; var permalinkButton; + var unhidePreviewButton; if (eventStatus === 'not_sent') { resendButton = ( @@ -104,6 +114,18 @@ module.exports = React.createClass({ ); + + if (global.localStorage) { + // FIXME: factor this out with LinkPreviewWidget + if (global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()) === "1") { + unhidePreviewButton = ( +