From d7f52fb6f44201040ee558c42dedb3e7ab3eeaf5 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 25 Dec 2021 11:00:51 +0000 Subject: [PATCH] fix(sidebar): force open on mobile devices --- src/components/navigation/LeftSidebar.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/navigation/LeftSidebar.tsx b/src/components/navigation/LeftSidebar.tsx index 2e61cc15..ff329841 100644 --- a/src/components/navigation/LeftSidebar.tsx +++ b/src/components/navigation/LeftSidebar.tsx @@ -1,6 +1,8 @@ import { observer } from "mobx-react-lite"; import { Route, Switch } from "react-router"; +import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice"; + import { useApplicationState } from "../../mobx/State"; import { SIDEBAR_CHANNELS } from "../../mobx/stores/Layout"; @@ -11,7 +13,8 @@ import ServerSidebar from "./left/ServerSidebar"; export default observer(() => { const layout = useApplicationState().layout; - const isOpen = layout.getSectionState(SIDEBAR_CHANNELS, true); + const isOpen = + isTouchscreenDevice || layout.getSectionState(SIDEBAR_CHANNELS, true); return (