Minimize widgets by default

Fixes https://github.com/vector-im/riot-web/issues/12921
This commit is contained in:
Travis Ralston 2020-04-09 14:47:20 -06:00
parent ef8c5033ee
commit 34be024b21
2 changed files with 7 additions and 10 deletions

View file

@ -81,12 +81,14 @@ export default createReactClass({
const hideWidgetKey = this.props.room.roomId + '_hide_widget_drawer';
switch (action.action) {
case 'appsDrawer':
// Note: these booleans are awkward because localstorage is fundamentally
// string-based. We also do exact equality on the strings later on.
if (action.show) {
localStorage.removeItem(hideWidgetKey);
localStorage.setItem(hideWidgetKey, "false");
} else {
// Store hidden state of widget
// Don't show if previously hidden
localStorage.setItem(hideWidgetKey, true);
localStorage.setItem(hideWidgetKey, "true");
}
break;