From 69660b1d10a3cb7e153f3cf641be7c20a29b2b05 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Fri, 22 Sep 2023 11:18:46 +0530 Subject: [PATCH] Add ErrorBoundaries to Home --- src/App.jsx | 6 +- src/components/carouselSlide/index.jsx | 10 + src/routes/home/index.jsx | 616 ++++++++++++++----------- 3 files changed, 366 insertions(+), 266 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 57e209f..871f067 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -173,7 +173,7 @@ function App() { const usersAvailable = async () => { const users = await getUserApi(window.api).getPublicUsers(); - if (users.data.length >= 1) { + if (users.status == 200 || users.data.length >= 1) { return true; } else { return false; @@ -280,6 +280,10 @@ function App() { const location = useLocation(); + useEffect(() => { + window.scrollTo(0, 0); + }, [location.key]); + if (!window.api) { serverAvailable().then((available) => { if (available) { diff --git a/src/components/carouselSlide/index.jsx b/src/components/carouselSlide/index.jsx index ccf78c6..3b0a5b9 100644 --- a/src/components/carouselSlide/index.jsx +++ b/src/components/carouselSlide/index.jsx @@ -282,6 +282,16 @@ const CarouselSlide = ({ item }) => { size: "large", }} itemUserData={item.UserData} + audio={ + item.Type == BaseItemKind.MusicAlbum || + item.Type == BaseItemKind.Audio || + item.Type == BaseItemKind.AudioBook || + item.Type == BaseItemKind.Playlist + } + playlistItem={ + item.Type == BaseItemKind.Playlist + } + playlistItemId={item.Id} />