mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-17 06:00:20 +02:00
re-add default suspense to album/artist routes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { UseSuspenseQueryResult } from '@tanstack/react-query';
|
||||
|
||||
import { closeAllModals, openModal } from '@mantine/modals';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -25,7 +26,7 @@ import { toast } from '/@/shared/components/toast/toast';
|
||||
import { SongListSort } from '/@/shared/types/domain-types';
|
||||
|
||||
export interface PlaylistQueryEditorProps {
|
||||
detailQuery: ReturnType<typeof useQuery<any>>;
|
||||
detailQuery: UseSuspenseQueryResult<any, Error>;
|
||||
handleSave: (
|
||||
filter: Record<string, any>,
|
||||
extraFilters: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { closeAllModals, openModal } from '@mantine/modals';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useSuspenseQuery } from '@tanstack/react-query';
|
||||
import { Suspense, useMemo, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { generatePath, useLocation, useNavigate, useParams } from 'react-router';
|
||||
import { generatePath, useNavigate, useParams } from 'react-router';
|
||||
|
||||
import { ListContext, useListContext } from '/@/renderer/context/list-context';
|
||||
import { playlistsQueries } from '/@/renderer/features/playlists/api/playlists-api';
|
||||
@@ -72,13 +72,11 @@ const PlaylistSongListFiltersSidebar = () => {
|
||||
const PlaylistDetailSongListRoute = () => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const { playlistId } = useParams() as { playlistId: string };
|
||||
const server = useCurrentServer();
|
||||
|
||||
const detailQuery = useQuery({
|
||||
const detailQuery = useSuspenseQuery({
|
||||
...playlistsQueries.detail({ query: { id: playlistId }, serverId: server?.id }),
|
||||
placeholderData: location.state?.item,
|
||||
});
|
||||
const deletePlaylistMutation = useDeletePlaylist({});
|
||||
const updatePlaylistMutation = useUpdatePlaylist({});
|
||||
@@ -212,9 +210,7 @@ const PlaylistDetailSongListRoute = () => {
|
||||
};
|
||||
|
||||
const isSmartPlaylist = Boolean(
|
||||
!detailQuery?.isLoading &&
|
||||
detailQuery?.data?.rules &&
|
||||
server?.type === ServerType.NAVIDROME,
|
||||
detailQuery?.data?.rules && server?.type === ServerType.NAVIDROME,
|
||||
);
|
||||
|
||||
const [showQueryBuilder, setShowQueryBuilder] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user