extract always visible logic to RoomList
This commit is contained in:
parent
b9f80b49ad
commit
f1453e8d2b
2 changed files with 10 additions and 6 deletions
|
@ -60,11 +60,6 @@ export const HEADER_HEIGHT = 32; // As defined by CSS
|
|||
|
||||
const MAX_PADDING_HEIGHT = SHOW_N_BUTTON_HEIGHT + RESIZE_HANDLE_HEIGHT;
|
||||
|
||||
const ALWAYS_VISIBLE_TAGS: TagID[] = [
|
||||
DefaultTagID.DM,
|
||||
DefaultTagID.Untagged,
|
||||
];
|
||||
|
||||
// HACK: We really shouldn't have to do this.
|
||||
polyfillTouchEvent();
|
||||
|
||||
|
@ -79,6 +74,7 @@ interface IProps {
|
|||
tagId: TagID;
|
||||
onResize: () => void;
|
||||
showSkeleton?: boolean;
|
||||
alwaysVisible?: boolean;
|
||||
|
||||
extraTiles?: ReactComponentElement<typeof ExtraTile>[];
|
||||
|
||||
|
@ -767,7 +763,7 @@ export default class RoomSublist extends React.Component<IProps, IState> {
|
|||
'mx_RoomSublist': true,
|
||||
'mx_RoomSublist_hasMenuOpen': !!this.state.contextMenuPosition,
|
||||
'mx_RoomSublist_minimized': this.props.isMinimized,
|
||||
'mx_RoomSublist_hidden': !this.state.rooms.length && !ALWAYS_VISIBLE_TAGS.includes(this.props.tagId),
|
||||
'mx_RoomSublist_hidden': !this.state.rooms.length && this.props.alwaysVisible !== true,
|
||||
});
|
||||
|
||||
let content = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue