mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
upgrade and refactor for react-query v5
This commit is contained in:
parent
dd70d30cd3
commit
8115963264
94 changed files with 1650 additions and 1750 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { closeAllModals, openModal } from '@mantine/modals';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import clsx from 'clsx';
|
||||
import { MouseEvent, useCallback, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
|
@ -8,7 +9,8 @@ import { Link } from 'react-router-dom';
|
|||
import styles from './sidebar-playlist-list.module.css';
|
||||
|
||||
import { usePlayQueueAdd } from '/@/renderer/features/player';
|
||||
import { CreatePlaylistForm, usePlaylistList } from '/@/renderer/features/playlists';
|
||||
import { CreatePlaylistForm } from '/@/renderer/features/playlists';
|
||||
import { playlistsQueries } from '/@/renderer/features/playlists/api/playlists-api';
|
||||
import { SidebarItem } from '/@/renderer/features/sidebar/components/sidebar-item';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import { useCurrentServer } from '/@/renderer/store';
|
||||
|
|
@ -142,14 +144,16 @@ export const SidebarPlaylistList = () => {
|
|||
const { t } = useTranslation();
|
||||
const server = useCurrentServer();
|
||||
|
||||
const playlistsQuery = usePlaylistList({
|
||||
query: {
|
||||
sortBy: PlaylistListSort.NAME,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: server?.id,
|
||||
});
|
||||
const playlistsQuery = useQuery(
|
||||
playlistsQueries.list({
|
||||
query: {
|
||||
sortBy: PlaylistListSort.NAME,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: server?.id,
|
||||
}),
|
||||
);
|
||||
|
||||
const handlePlayPlaylist = useCallback(
|
||||
(id: string, playType: Play) => {
|
||||
|
|
@ -258,14 +262,16 @@ export const SidebarSharedPlaylistList = () => {
|
|||
const { t } = useTranslation();
|
||||
const server = useCurrentServer();
|
||||
|
||||
const playlistsQuery = usePlaylistList({
|
||||
query: {
|
||||
sortBy: PlaylistListSort.NAME,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: server?.id,
|
||||
});
|
||||
const playlistsQuery = useQuery(
|
||||
playlistsQueries.list({
|
||||
query: {
|
||||
sortBy: PlaylistListSort.NAME,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: server?.id,
|
||||
}),
|
||||
);
|
||||
|
||||
const handlePlayPlaylist = useCallback(
|
||||
(id: string, playType: Play) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue