Skip to content

Commit efd01d6

Browse files
committed
move localstorage crap entirely to TextualBody
1 parent cdc89c0 commit efd01d6

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ module.exports = React.createClass({
7878
},
7979

8080
onUnhidePreviewClick: function() {
81-
if (global.localStorage) {
82-
// FIXME: factor this out with LinkPreviewWidget
83-
global.localStorage.removeItem("hide_preview_" + this.props.mxEvent.getId());
84-
}
8581
if (this.props.eventTileOps) {
8682
this.props.eventTileOps.unhideWidget();
8783
}
@@ -127,10 +123,8 @@ module.exports = React.createClass({
127123
</div>
128124
);
129125

130-
131-
if (global.localStorage) {
132-
// FIXME: factor this out with LinkPreviewWidget
133-
if (global.localStorage.getItem("hide_preview_" + this.props.mxEvent.getId()) === "1") {
126+
if (this.props.eventTileOps) {
127+
if (this.props.eventTileOps.isWidgetHidden()) {
134128
unhidePreviewButton = (
135129
<div className="mx_ContextualMenu_field" onClick={this.onUnhidePreviewClick}>
136130
Unhide Preview

0 commit comments

Comments
 (0)