Skip to content

Commit d414127

Browse files
committed
track whether widget should be hidden on the event, as well as persisting it in localStorage
1 parent ff28850 commit d414127

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/components/views/rooms/MessageContextMenu.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ module.exports = React.createClass({
7171
// FIXME: factor this out with LinkPreviewWidget
7272
// FIXME: somehow propagate this to the EventTile such that it updates itself and realises the link has rematerialised
7373
global.localStorage.removeItem("hide_preview_" + this.props.mxEvent.getId());
74-
if (this.props.onFinished) this.props.onFinished();
7574
}
75+
this.props.mxEvent.widgetHidden = false;
76+
if (this.props.onFinished) this.props.onFinished();
7677
},
7778

7879
render: function() {
@@ -116,7 +117,7 @@ module.exports = React.createClass({
116117

117118

118119
if (global.localStorage) {
119-
// FIXME: factor this out with LinkPreviewWidget
120+
// FIXME: factor this out with LinkPreviewWidget
120121
if (global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()) === "1") {
121122
unhidePreviewButton = (
122123
<div className="mx_ContextualMenu_field" onClick={this.onUnhidePreviewClick}>

0 commit comments

Comments
 (0)