showWidget->hideWidgetDrawer and remove logs
Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>
This commit is contained in:
parent
9821f0d459
commit
b4868a6846
2 changed files with 8 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue