track whether widget should be hidden on the event, as well as persisting it in localStorage

This commit is contained in:
Matthew Hodgson 2016-04-03 23:31:42 +01:00
parent ff2885087d
commit d414127f80
1 changed files with 3 additions and 2 deletions

View File

@ -71,8 +71,9 @@ module.exports = React.createClass({
// FIXME: factor this out with LinkPreviewWidget // FIXME: factor this out with LinkPreviewWidget
// FIXME: somehow propagate this to the EventTile such that it updates itself and realises the link has rematerialised // 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()); 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() { render: function() {
@ -116,7 +117,7 @@ module.exports = React.createClass({
if (global.localStorage) { 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") { if (global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()) === "1") {
unhidePreviewButton = ( unhidePreviewButton = (
<div className="mx_ContextualMenu_field" onClick={this.onUnhidePreviewClick}> <div className="mx_ContextualMenu_field" onClick={this.onUnhidePreviewClick}>