Remember whether widget drawer was hidden per-room
Fixes #4850 Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>
This commit is contained in:
parent
0463f0e581
commit
f032284eff
2 changed files with 28 additions and 3 deletions
|
@ -83,14 +83,25 @@ module.exports = React.createClass({
|
|||
onAction: function(action) {
|
||||
switch (action.action) {
|
||||
case 'appsDrawer':
|
||||
// When opening the app draw when there aren't any apps, auto-launch the
|
||||
// integrations manager to skip the awkward click on "Add widget"
|
||||
// When opening the app drawer when there aren't any apps,
|
||||
// auto-launch the integrations manager to skip the awkward
|
||||
// click on "Add widget"
|
||||
let widgetStateKey = this.props.room.roomId + "_show_widget_drawer";
|
||||
if (action.show) {
|
||||
const apps = this._getApps();
|
||||
if (apps.length === 0) {
|
||||
this._launchManageIntegrations();
|
||||
}
|
||||
|
||||
localStorage.removeItem(widgetStateKey);
|
||||
} 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);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue