diff --git a/src/App.jsx b/src/App.jsx index 3b34a47..7f5144b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -59,6 +59,8 @@ import { v4 as uuidv4 } from "uuid"; import { delServer, getServer } from "./utils/storage/servers.js"; import { getUser } from "./utils/storage/user.js"; +import { useDispatch } from "react-redux"; +import { showSidemenu } from "./utils/slice/sidemenu.js"; const jellyfin = new Jellyfin({ clientInfo: { name: "JellyPlayer", @@ -120,12 +122,15 @@ const AnimationWrapper = () => { function App() { const navigate = useNavigate(); + const dispatch = useDispatch(); + const [serverReachable, setServerReachable] = useState(true); const [checkingServer, setChecking] = useState(false); const createApi = async () => { const server = await getServer(); event.emit("create-jellyfin-api", server.Ip); + dispatch(showSidemenu()); }; const serverAvailable = async () => { diff --git a/src/routes/home/root.jsx b/src/routes/home/root.jsx index d3039ba..340c8b5 100644 --- a/src/routes/home/root.jsx +++ b/src/routes/home/root.jsx @@ -85,7 +85,6 @@ const Home = () => { const libraries = useQuery({ queryKey: ["home", "libraries"], queryFn: async () => { - dispatch(showSidemenu()); let libs = await getUserViewsApi(window.api).getUserViews({ userId: user.data.Id, }); diff --git a/src/routes/library/root.jsx b/src/routes/library/root.jsx index 04184dc..6839877 100644 --- a/src/routes/library/root.jsx +++ b/src/routes/library/root.jsx @@ -1,9 +1,58 @@ /** @format */ +import { useState, useEffect } from "react"; +import { useDispatch, useSelector } from "react-redux"; +import { showAppBar, setBackdrop } from "../../utils/slice/appBar"; import { useParams } from "react-router-dom"; +import Box from "@mui/material/Box"; +import useScrollTrigger from "@mui/material/useScrollTrigger"; + const LibraryView = () => { + const dispatch = useDispatch(); + const appBarVisiblity = useSelector((state) => state.appBar.visible); + + if (!appBarVisiblity) { + dispatch(showAppBar()); + } const { id } = useParams(); - return