mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
Correctly handle defaults
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
791f39abcc
commit
2044ff0149
@ -70,9 +70,10 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
const collapsedLocalStorage = localStorage.getItem(getSpaceCollapsedKey(props.space));
|
||||||
// XXX: localStorage doesn't allow booleans
|
// XXX: localStorage doesn't allow booleans
|
||||||
// default to collapsed for root items
|
// default to collapsed for root items
|
||||||
const collapsed = localStorage.getItem(getSpaceCollapsedKey(props.space)) === "true" || !props.isNested;
|
const collapsed = collapsedLocalStorage ? collapsedLocalStorage === "true" : !props.isNested;
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
collapsed: collapsed,
|
collapsed: collapsed,
|
||||||
|
Loading…
Reference in New Issue
Block a user