feat: updates

This commit is contained in:
qier222 2022-07-11 11:06:41 +08:00
parent 0b4baa3eff
commit 222fb02355
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
77 changed files with 654 additions and 551 deletions

View file

@ -1,8 +1,5 @@
import {
fetchListenedRecords,
FetchListenedRecordsParams,
} from '@/web/api/user'
import { UserApiNames } from '@/shared/api/User'
import { fetchListenedRecords } from '@/web/api/user'
import { UserApiNames, FetchListenedRecordsResponse } from '@/shared/api/User'
import { APIs } from '@/shared/CacheAPIs'
import { IpcChannels } from '@/shared/IpcChannels'
import { useQuery } from 'react-query'
@ -24,10 +21,10 @@ export default function useUserListenedRecords(params: {
{
refetchOnWindowFocus: false,
enabled: !!uid,
// placeholderData: (): FetchUserArtistsResponse =>
// window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
// api: APIs.UserArtists,
// }),
placeholderData: (): FetchListenedRecordsResponse =>
window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
api: APIs.UserArtists,
}),
}
)
}

View file

@ -5,6 +5,7 @@ import { IpcChannels } from '@/shared/IpcChannels'
import { APIs } from '@/shared/CacheAPIs'
import { fetchUserPlaylists } from '@/web/api/user'
import { FetchUserPlaylistsResponse, UserApiNames } from '@/shared/api/User'
import toast from 'react-hot-toast'
export default function useUserPlaylists() {
const { data: user } = useUser()