fix(sidebar): force open on mobile devices

This commit is contained in:
Paul 2021-12-25 11:00:51 +00:00
parent 8a0033699d
commit d7f52fb6f4

View file

@ -1,6 +1,8 @@
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { Route, Switch } from "react-router"; import { Route, Switch } from "react-router";
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
import { useApplicationState } from "../../mobx/State"; import { useApplicationState } from "../../mobx/State";
import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout"; import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout";
@ -11,7 +13,8 @@ import ServerSidebar from "./left/ServerSidebar";
export default observer(() => { export default observer(() => {
const layout = useApplicationState().layout; const layout = useApplicationState().layout;
const isOpen = layout.getSectionState(SIDEBAR_CHANNELS, true); const isOpen =
isTouchscreenDevice || layout.getSectionState(SIDEBAR_CHANNELS, true);
return ( return (
<SidebarBase> <SidebarBase>