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) {
|
_shouldShowApps: function(room) {
|
||||||
if (!BROWSER_SUPPORTS_SANDBOX) return false;
|
if (!BROWSER_SUPPORTS_SANDBOX) return false;
|
||||||
|
|
||||||
// Check if user has prompted to close this app before
|
// Check if user has previously chosen to hide the app drawer for this
|
||||||
// If so, do not show apps
|
// room. If so, do not show apps
|
||||||
let showWidget = localStorage.getItem(
|
let hideWidgetDrawer = localStorage.getItem(
|
||||||
room.roomId + "_show_widget_drawer");
|
room.roomId + "_hide_widget_drawer");
|
||||||
|
|
||||||
console.warn(room);
|
if (hideWidgetDrawer === "true") {
|
||||||
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.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction: function(action) {
|
onAction: function(action) {
|
||||||
const widgetStateKey = this.props.room.roomId + "_show_widget_drawer";
|
const hideWidgetKey = this.props.room.roomId + "_hide_widget_drawer";
|
||||||
switch (action.action) {
|
switch (action.action) {
|
||||||
case 'appsDrawer':
|
case 'appsDrawer':
|
||||||
// When opening the app drawer when there aren't any apps,
|
// When opening the app drawer when there aren't any apps,
|
||||||
|
@ -93,13 +93,11 @@ module.exports = React.createClass({
|
||||||
this._launchManageIntegrations();
|
this._launchManageIntegrations();
|
||||||
}
|
}
|
||||||
|
|
||||||
localStorage.removeItem(widgetStateKey);
|
localStorage.removeItem(hideWidgetKey);
|
||||||
} else {
|
} else {
|
||||||
// Store hidden state of widget
|
// Store hidden state of widget
|
||||||
// Don't show if previously hidden
|
// Don't show if previously hidden
|
||||||
console.warn("Storing hidden widget state for room - ",
|
localStorage.setItem(hideWidgetKey, true);
|
||||||
this.props.room.roomId);
|
|
||||||
localStorage.setItem(widgetStateKey, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue