2022-04-09 00:28:37 +08:00
|
|
|
import type { FetchUserArtistsResponse } from '@/renderer/api/user'
|
|
|
|
import { UserApiNames, fetchUserArtists } from '@/renderer/api/user'
|
|
|
|
import { IpcChannels } from '@/main/IpcChannelsName'
|
2022-04-05 02:31:10 +08:00
|
|
|
|
|
|
|
export default function useUserArtists() {
|
|
|
|
return useQuery([UserApiNames.FETCH_USER_ARTIST], fetchUserArtists, {
|
2022-04-05 23:02:59 +08:00
|
|
|
refetchOnWindowFocus: true,
|
2022-04-05 02:31:10 +08:00
|
|
|
placeholderData: (): FetchUserArtistsResponse =>
|
2022-04-09 00:28:37 +08:00
|
|
|
window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
|
2022-04-05 02:31:10 +08:00
|
|
|
api: 'album/sublist',
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
}
|