feat: updates

This commit is contained in:
qier222 2022-04-16 21:14:03 +08:00
parent fc1c25f404
commit 7b6579e068
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
48 changed files with 1155 additions and 777 deletions

View file

@ -1,7 +1,12 @@
import { TrackApiNames, fetchLyric } from '@/renderer/api/track'
import type { FetchLyricParams, FetchLyricResponse } from '@/renderer/api/track'
import { fetchLyric } from '@/renderer/api/track'
import reactQueryClient from '@/renderer/utils/reactQueryClient'
import { IpcChannels } from '@/main/IpcChannelsName'
import {
FetchLyricParams,
FetchLyricResponse,
TrackApiNames,
} from '@/shared/api/Track'
import { APIs } from '@/shared/CacheAPIs'
import { IpcChannels } from '@/shared/IpcChannels'
export default function useLyric(params: FetchLyricParams) {
return useQuery(
@ -15,7 +20,7 @@ export default function useLyric(params: FetchLyricParams) {
staleTime: Infinity,
initialData: (): FetchLyricResponse | undefined =>
window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
api: 'lyric',
api: APIs.Lyric,
query: {
id: params.id,
},