[bugfix/feature]: Improve ratings (#332)

* [bugfix/feature]: Improve ratings

Fix: add preventDefault/stopPropagation to prevent scrolling to top in queue
Feat: instead of double click for clear, click on same value
This commit is contained in:
Kendall Garner 2023-10-29 03:00:01 +00:00 committed by GitHub
parent e5564c2ac2
commit 4ec981df83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 79 deletions

View file

@ -55,18 +55,6 @@ export const AlbumDetailHeader = forwardRef(
});
};
const handleClearRating = () => {
if (!detailQuery?.data || !detailQuery?.data.userRating) return;
updateRatingMutation.mutate({
query: {
item: [detailQuery.data],
rating: 0,
},
serverId: detailQuery.data.serverId,
});
};
const showRating = detailQuery?.data?.serverType === ServerType.NAVIDROME;
return (
@ -96,7 +84,6 @@ export const AlbumDetailHeader = forwardRef(
}
value={detailQuery?.data?.userRating || 0}
onChange={handleUpdateRating}
onClick={handleClearRating}
/>
</>
)}