feat: adding setting to show/hide user ratings (#1426)

* adding show/hide user ratings setting
This commit is contained in:
Leonardo Salgueiro
2025-12-28 09:04:50 +00:00
committed by GitHub
parent f0942c7795
commit df0d4b7032
9 changed files with 59 additions and 13 deletions
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useSetRating } from '/@/renderer/features/shared/mutations/set-rating-mutation';
import { useCurrentServer, useCurrentServerId } from '/@/renderer/store';
import { useCurrentServer, useCurrentServerId, useGeneralSettings } from '/@/renderer/store';
import { ContextMenu } from '/@/shared/components/context-menu/context-menu';
import { Rating } from '/@/shared/components/rating/rating';
import { LibraryItem } from '/@/shared/types/domain-types';
@@ -17,6 +17,7 @@ export const SetRatingAction = ({ ids, itemType }: SetRatingActionProps) => {
const { t } = useTranslation();
const server = useCurrentServer();
const serverId = useCurrentServerId();
const { showRatings } = useGeneralSettings();
const setRatingMutation = useSetRating({});
@@ -35,7 +36,7 @@ export const SetRatingAction = ({ ids, itemType }: SetRatingActionProps) => {
});
};
if (!isRatingSupported) {
if (!showRatings || !isRatingSupported) {
return null;
}