Migrate react-query to v5
This commit is contained in:
21 files changed
+66
-86
No files matched your search
+9
-29
@@ -15,8 +15,6 @@ import {
|
|||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { EventEmitter as event } from "./eventEmitter.js";
|
|
||||||
|
|
||||||
import { relaunch } from "@tauri-apps/api/process";
|
import { relaunch } from "@tauri-apps/api/process";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
@@ -96,13 +94,8 @@ import ArtistTitlePage from "./routes/artist/index.jsx";
|
|||||||
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
||||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||||
|
|
||||||
// Initial custom axios client to use tauri's http module
|
|
||||||
import axios from "axios";
|
|
||||||
import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
|
||||||
import { createApi, useApi } from "./utils/store/api.js";
|
import { createApi, useApi } from "./utils/store/api.js";
|
||||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api.js";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { Navigate } from "react-router-dom";
|
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
||||||
import { CircularProgress } from "@mui/material";
|
import { CircularProgress } from "@mui/material";
|
||||||
|
|
||||||
const anim = {
|
const anim = {
|
||||||
@@ -149,9 +142,9 @@ const LogicalRoute = () => {
|
|||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
if (
|
if (
|
||||||
!defaultServer.isLoading &&
|
!defaultServer.isPending &&
|
||||||
!server.isLoading &&
|
!server.isPending &&
|
||||||
!userSaved.isLoading
|
!userSaved.isPending
|
||||||
) {
|
) {
|
||||||
if (defaultServer.data) {
|
if (defaultServer.data) {
|
||||||
if (userSaved.data) {
|
if (userSaved.data) {
|
||||||
@@ -237,21 +230,15 @@ const AnimationWrapper = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {[import("@jellyfin/sdk").Api, import("@jellyfin/sdk").Jellyfin]}
|
* @type {[import("@jellyfin/sdk").Api]}
|
||||||
*/
|
*/
|
||||||
const [api, jellyfin] = useApi((state) => [
|
const [api] = useApi((state) => [state.api]);
|
||||||
state.api,
|
|
||||||
state.createApi,
|
|
||||||
state.jellyfin,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const [serverReachable, setServerReachable] = useState(true);
|
const [serverReachable] = useState(true);
|
||||||
|
|
||||||
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
|
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
|
||||||
state.isLoading,
|
state.isPending,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
@@ -265,11 +252,6 @@ function App() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const LoginLogicalRoutes = () => {
|
|
||||||
// usersAvailable();
|
|
||||||
return <h1>/Login</h1>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRelaunch = async (event, reason) => {
|
const handleRelaunch = async (event, reason) => {
|
||||||
if (reason && reason == "backdropClick") {
|
if (reason && reason == "backdropClick") {
|
||||||
return;
|
return;
|
||||||
@@ -307,9 +289,7 @@ function App() {
|
|||||||
console.log(location);
|
console.log(location);
|
||||||
}, [location.key]);
|
}, [location.key]);
|
||||||
|
|
||||||
const [audioPlayerVisible, currentAudioIndex] = useAudioPlayback(
|
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||||
(state) => [state.display, state.currentTrack],
|
|
||||||
);
|
|
||||||
|
|
||||||
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
||||||
state.backdropUrl,
|
state.backdropUrl,
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ const LikeButton = ({
|
|||||||
>
|
>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
style={{
|
style={{
|
||||||
opacity: mutation.isLoading ? 1 : 0,
|
opacity: mutation.isPending ? 1 : 0,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (!mutation.isLoading) {
|
if (!mutation.isPending) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
mutation.mutate();
|
mutation.mutate();
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ const LikeButton = ({
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
opacity: mutation.isLoading ? 0.5 : 1,
|
opacity: mutation.isPending ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isFavorite ? (
|
{isFavorite ? (
|
||||||
|
|||||||
@@ -64,13 +64,13 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
|||||||
>
|
>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
style={{
|
style={{
|
||||||
opacity: mutation.isLoading ? 1 : 0,
|
opacity: mutation.isPending ? 1 : 0,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (!mutation.isLoading) {
|
if (!mutation.isPending) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
mutation.mutate();
|
mutation.mutate();
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
opacity: mutation.isLoading ? 0.5 : 1,
|
opacity: mutation.isPending ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiCheck
|
<MdiCheck
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const PlayButton = ({
|
|||||||
state.setPlaylistItemId,
|
state.setPlaylistItemId,
|
||||||
]);
|
]);
|
||||||
const setPlaybackDataLoading = usePlaybackDataLoadStore(
|
const setPlaybackDataLoading = usePlaybackDataLoadStore(
|
||||||
(state) => state.setIsLoading,
|
(state) => state.setisPending,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
if (data.isLoading) {
|
if (data.isPending) {
|
||||||
return <CardsSkeleton />;
|
return <CardsSkeleton />;
|
||||||
}
|
}
|
||||||
if (data.isSuccess && data.data.length >= 1) {
|
if (data.isSuccess && data.data.length >= 1) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export const SideMenu = () => {
|
|||||||
}}
|
}}
|
||||||
></DrawerHeader>
|
></DrawerHeader>
|
||||||
<div className="sidemenu-item-container">
|
<div className="sidemenu-item-container">
|
||||||
{libraries.isLoading ? (
|
{libraries.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -238,7 +238,7 @@ export const SideMenu = () => {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</DrawerHeader>
|
</DrawerHeader>
|
||||||
<Divider />
|
<Divider />
|
||||||
{libraries.isLoading ? (
|
{libraries.isPending ? (
|
||||||
<>
|
<>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
height="100%"
|
height="100%"
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -198,7 +198,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
audioPlayButton
|
audioPlayButton
|
||||||
cardType="square"
|
cardType="square"
|
||||||
/>
|
/>
|
||||||
{musicTracks.isLoading ? (
|
{musicTracks.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
musicTracks.data.TotalRecordCount > 0 && (
|
musicTracks.data.TotalRecordCount > 0 && (
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
artistDiscography.isLoading,
|
artistDiscography.isPending,
|
||||||
artistSongs.isLoading,
|
artistSongs.isPending,
|
||||||
artistAppearances.isLoading,
|
artistAppearances.isPending,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||||
@@ -180,7 +180,7 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ const BoxSetTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ const EpisodeTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ const Home = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ErrorBoundary fallback={<CarouselSlideError />}>
|
<ErrorBoundary fallback={<CarouselSlideError />}>
|
||||||
{latestMedia.isLoading ? (
|
{latestMedia.isPending ? (
|
||||||
<CarouselSkeleton />
|
<CarouselSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<Carousel
|
<Carousel
|
||||||
@@ -224,7 +224,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{libraries.isLoading ? (
|
{libraries.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
@@ -279,7 +279,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{upNextItems.isLoading ? (
|
{upNextItems.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : upNextItems.isSuccess &&
|
) : upNextItems.isSuccess &&
|
||||||
upNextItems.data.Items.length == 0 ? (
|
upNextItems.data.Items.length == 0 ? (
|
||||||
@@ -373,7 +373,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{resumeItemsVideo.isLoading ? (
|
{resumeItemsVideo.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : resumeItemsVideo.isSuccess &&
|
) : resumeItemsVideo.isSuccess &&
|
||||||
resumeItemsVideo.data.Items.length == 0 ? (
|
resumeItemsVideo.data.Items.length == 0 ? (
|
||||||
@@ -468,7 +468,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{resumeItemsAudio.isLoading ? (
|
{resumeItemsAudio.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : resumeItemsAudio.isSuccess &&
|
) : resumeItemsAudio.isSuccess &&
|
||||||
resumeItemsAudio.data.Items.length == 0 ? (
|
resumeItemsAudio.data.Items.length == 0 ? (
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ const ItemDetail = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ const LibraryView = () => {
|
|||||||
sx={{ mr: 2, flexShrink: 0 }}
|
sx={{ mr: 2, flexShrink: 0 }}
|
||||||
noWrap
|
noWrap
|
||||||
>
|
>
|
||||||
{currentLib.isLoading ? (
|
{currentLib.isPending ? (
|
||||||
<CircularProgress sx={{ p: 1 }} />
|
<CircularProgress sx={{ p: 1 }} />
|
||||||
) : (
|
) : (
|
||||||
currentLib.data.Items[0].Name
|
currentLib.data.Items[0].Name
|
||||||
@@ -383,7 +383,7 @@ const LibraryView = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Chip
|
<Chip
|
||||||
label={
|
label={
|
||||||
items.isLoading ? (
|
items.isPending ? (
|
||||||
<CircularProgress sx={{ p: 1.5 }} />
|
<CircularProgress sx={{ p: 1.5 }} />
|
||||||
) : (
|
) : (
|
||||||
items.data.TotalRecordCount
|
items.data.TotalRecordCount
|
||||||
@@ -1247,7 +1247,7 @@ const LibraryView = () => {
|
|||||||
</Popper>
|
</Popper>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{items.isLoading ? (
|
{items.isPending ? (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ export const UserLogin = () => {
|
|||||||
enabled: Boolean(api),
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (users.isLoading) {
|
if (users.isPending) {
|
||||||
return <LinearProgress />;
|
return <LinearProgress />;
|
||||||
}
|
}
|
||||||
if (users.isSuccess) {
|
if (users.isSuccess) {
|
||||||
@@ -407,7 +407,7 @@ export const UserLoginManual = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{server.isLoading && <LinearProgress />}
|
{server.isPending && <LinearProgress />}
|
||||||
<AppBarBackOnly />
|
<AppBarBackOnly />
|
||||||
<Container
|
<Container
|
||||||
maxWidth="xs"
|
maxWidth="xs"
|
||||||
@@ -425,7 +425,7 @@ export const UserLoginManual = () => {
|
|||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
sx={{
|
sx={{
|
||||||
opacity: server.isLoading ? 0 : 1,
|
opacity: server.isPending ? 0 : 1,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -228,11 +228,11 @@ const PersonTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
personMovies.isLoading,
|
personMovies.isPending,
|
||||||
personShows.isLoading,
|
personShows.isPending,
|
||||||
personBooks.isLoading,
|
personBooks.isPending,
|
||||||
personPhotos.isLoading,
|
personPhotos.isPending,
|
||||||
personEpisodes.isLoading,
|
personEpisodes.isPending,
|
||||||
]);
|
]);
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ const PersonTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ export const VideoPlayer = () => {
|
|||||||
onClick={handlePlayPrevEpisode}
|
onClick={handlePlayPrevEpisode}
|
||||||
disabled={
|
disabled={
|
||||||
seriesId
|
seriesId
|
||||||
? episodes.isLoading ||
|
? episodes.isPending ||
|
||||||
currentEpisodeIndex == 0
|
currentEpisodeIndex == 0
|
||||||
: true
|
: true
|
||||||
}
|
}
|
||||||
@@ -770,7 +770,7 @@ export const VideoPlayer = () => {
|
|||||||
onClick={handlePlayNextEpisode}
|
onClick={handlePlayNextEpisode}
|
||||||
disabled={
|
disabled={
|
||||||
seriesId
|
seriesId
|
||||||
? episodes.isLoading ||
|
? episodes.isPending ||
|
||||||
episodes.data
|
episodes.data
|
||||||
?.TotalRecordCount ==
|
?.TotalRecordCount ==
|
||||||
currentEpisodeIndex +
|
currentEpisodeIndex +
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ const PlaylistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -160,7 +160,7 @@ const PlaylistTitlePage = () => {
|
|||||||
audioPlayButton
|
audioPlayButton
|
||||||
cardType="square"
|
cardType="square"
|
||||||
/>
|
/>
|
||||||
{musicTracks.isLoading ? (
|
{musicTracks.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
musicTracks.data.TotalRecordCount > 0 &&
|
musicTracks.data.TotalRecordCount > 0 &&
|
||||||
|
|||||||
@@ -198,13 +198,13 @@ const SearchPage = () => {
|
|||||||
Boolean(
|
Boolean(
|
||||||
searchTerm,
|
searchTerm,
|
||||||
) &&
|
) &&
|
||||||
(movies.isLoading ||
|
(movies.isPending ||
|
||||||
series.isLoading ||
|
series.isPending ||
|
||||||
audio.isLoading ||
|
audio.isPending ||
|
||||||
musicAlbum.isLoading ||
|
musicAlbum.isPending ||
|
||||||
musicArtists.isLoading ||
|
musicArtists.isPending ||
|
||||||
person.isLoading ||
|
person.isPending ||
|
||||||
book.isLoading)
|
book.isPending)
|
||||||
? 1
|
? 1
|
||||||
: 0,
|
: 0,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -285,7 +285,7 @@ const SeriesTitlePage = () => {
|
|||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{seasons.isLoading ? (
|
{seasons.isPending ? (
|
||||||
<SeasonSelectorSkeleton />
|
<SeasonSelectorSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<div className="item-series-seasons-container">
|
<div className="item-series-seasons-container">
|
||||||
@@ -313,7 +313,7 @@ const SeriesTitlePage = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Chip
|
<Chip
|
||||||
label={
|
label={
|
||||||
episodes.isLoading ? (
|
episodes.isPending ? (
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
size={20}
|
size={20}
|
||||||
style={{
|
style={{
|
||||||
@@ -417,7 +417,7 @@ const SeriesTitlePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
<Divider />
|
<Divider />
|
||||||
<div className="item-detail-episodes-container">
|
<div className="item-detail-episodes-container">
|
||||||
{episodes.isLoading ? (
|
{episodes.isPending ? (
|
||||||
<EpisodeCardsSkeleton />
|
<EpisodeCardsSkeleton />
|
||||||
) : (
|
) : (
|
||||||
episodes.data.Items.map((episode) => {
|
episodes.data.Items.map((episode) => {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export const ServerSetup = () => {
|
|||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
opacity: checkServer.isLoading ? 1 : 0,
|
opacity: checkServer.isPending ? 1 : 0,
|
||||||
transition: "opacity 350ms",
|
transition: "opacity 350ms",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -96,7 +96,7 @@ export const ServerSetup = () => {
|
|||||||
maxWidth="sm"
|
maxWidth="sm"
|
||||||
className={"centered serverContainer"}
|
className={"centered serverContainer"}
|
||||||
style={{
|
style={{
|
||||||
opacity: checkServer.isLoading ? "0.5" : "1",
|
opacity: checkServer.isPending ? "0.5" : "1",
|
||||||
transition: "opacity 350ms",
|
transition: "opacity 350ms",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -126,7 +126,7 @@ export const ServerSetup = () => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%" }}
|
||||||
size="large"
|
size="large"
|
||||||
loading={checkServer.isLoading}
|
loading={checkServer.isPending}
|
||||||
endIcon={
|
endIcon={
|
||||||
<SvgIcon>
|
<SvgIcon>
|
||||||
<path d={mdiChevronRight}></path>
|
<path d={mdiChevronRight}></path>
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ export const usePlaybackStore = create((set) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const usePlaybackDataLoadStore = create((set) => ({
|
export const usePlaybackDataLoadStore = create((set) => ({
|
||||||
isLoading: false,
|
isPending: false,
|
||||||
setIsLoading: (loading) =>
|
setisPending: (loading) =>
|
||||||
set((state) => ({
|
set((state) => ({
|
||||||
...state,
|
...state,
|
||||||
isLoading: loading,
|
isPending: loading,
|
||||||
})),
|
})),
|
||||||
}));
|
}));
|
||||||
Reference in new issue
Block a user