mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 21:50:35 +02:00
add favorite songs section to artist page (#1604)
This commit is contained in:
@@ -4,6 +4,7 @@ import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { api } from '/@/renderer/api';
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { eventEmitter } from '/@/renderer/events/event-emitter';
|
||||
import {
|
||||
applyFavoriteOptimisticUpdates,
|
||||
@@ -63,6 +64,17 @@ export const useCreateFavorite = (args: MutationHookArgs) => {
|
||||
if (variables.query.type === LibraryItem.SONG) {
|
||||
remote?.updateFavorite(true, variables.apiClientProps.serverId, variables.query.id);
|
||||
}
|
||||
if (
|
||||
variables.query.type === LibraryItem.SONG ||
|
||||
variables.query.type === LibraryItem.PLAYLIST_SONG ||
|
||||
variables.query.type === LibraryItem.QUEUE_SONG
|
||||
) {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: queryKeys.albumArtists.favoriteSongs(
|
||||
variables.apiClientProps.serverId,
|
||||
),
|
||||
});
|
||||
}
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user