diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 583ce78785..38603f1805 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -305,17 +305,12 @@ module.exports = React.createClass({ _shouldShowApps: function(room) { if (!BROWSER_SUPPORTS_SANDBOX) return false; - // Check if user has prompted to close this app before - // If so, do not show apps - let showWidget = localStorage.getItem( - room.roomId + "_show_widget_drawer"); + // Check if user has previously chosen to hide the app drawer for this + // room. If so, do not show apps + let hideWidgetDrawer = localStorage.getItem( + room.roomId + "_hide_widget_drawer"); - console.warn(room); - console.warn("Key is: " + room.roomId + "_show_widget_drawer"); - console.warn("showWidget is: " + showWidget); - - if (showWidget == "false") { - console.warn("We're blocking the widget from loading."); + if (hideWidgetDrawer === "true") { return false; } diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 09bf4e616b..9a3ba5f329 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -81,7 +81,7 @@ module.exports = React.createClass({ }, onAction: function(action) { - const widgetStateKey = this.props.room.roomId + "_show_widget_drawer"; + const hideWidgetKey = this.props.room.roomId + "_hide_widget_drawer"; switch (action.action) { case 'appsDrawer': // When opening the app drawer when there aren't any apps, @@ -93,13 +93,11 @@ module.exports = React.createClass({ this._launchManageIntegrations(); } - localStorage.removeItem(widgetStateKey); + localStorage.removeItem(hideWidgetKey); } else { // Store hidden state of widget // Don't show if previously hidden - console.warn("Storing hidden widget state for room - ", - this.props.room.roomId); - localStorage.setItem(widgetStateKey, false); + localStorage.setItem(hideWidgetKey, true); } break;