fix: fixing sonar issues

This commit is contained in:
Chubby Granny Chaser 2025-01-22 10:11:30 +00:00
parent dcd16346ab
commit 93fc486e90
No known key found for this signature in database
2 changed files with 26 additions and 10 deletions

View File

@ -6,7 +6,7 @@ export interface DropdownMenuItem {
label: string;
disabled?: boolean;
show?: boolean;
onClick?: () => void | Promise<void>;
onClick?: () => void;
}
interface DropdownMenuProps {
@ -29,7 +29,7 @@ export function DropdownMenu({
loop = true,
align = "center",
alignOffset = 0,
}: DropdownMenuProps) {
}: Readonly<DropdownMenuProps>) {
return (
<DropdownMenuPrimitive.Root>
<DropdownMenuPrimitive.Trigger asChild>

View File

@ -179,7 +179,9 @@ export function DownloadGroup({
{
label: t("install"),
disabled: deleting,
onClick: () => openGameInstaller(game.shop, game.objectId),
onClick: () => {
openGameInstaller(game.shop, game.objectId);
},
icon: <DownloadIcon />,
},
{
@ -189,7 +191,9 @@ export function DownloadGroup({
show:
download.status === "seeding" &&
download.downloader === Downloader.Torrent,
onClick: () => pauseSeeding(game.shop, game.objectId),
onClick: () => {
pauseSeeding(game.shop, game.objectId);
},
},
{
label: t("resume_seeding"),
@ -198,13 +202,17 @@ export function DownloadGroup({
show:
download.status !== "seeding" &&
download.downloader === Downloader.Torrent,
onClick: () => resumeSeeding(game.shop, game.objectId),
onClick: () => {
resumeSeeding(game.shop, game.objectId);
},
},
{
label: t("delete"),
disabled: deleting,
icon: <TrashIcon />,
onClick: () => openDeleteGameModal(game.shop, game.objectId),
onClick: () => {
openDeleteGameModal(game.shop, game.objectId);
},
},
];
}
@ -213,12 +221,16 @@ export function DownloadGroup({
return [
{
label: t("pause"),
onClick: () => pauseDownload(game.shop, game.objectId),
onClick: () => {
pauseDownload(game.shop, game.objectId);
},
icon: <ColumnsIcon />,
},
{
label: t("cancel"),
onClick: () => cancelDownload(game.shop, game.objectId),
onClick: () => {
cancelDownload(game.shop, game.objectId);
},
icon: <XCircleIcon />,
},
];
@ -230,12 +242,16 @@ export function DownloadGroup({
disabled:
download?.downloader === Downloader.RealDebrid &&
!userPreferences?.realDebridApiToken,
onClick: () => resumeDownload(game.shop, game.objectId),
onClick: () => {
resumeDownload(game.shop, game.objectId);
},
icon: <PlayIcon />,
},
{
label: t("cancel"),
onClick: () => cancelDownload(game.shop, game.objectId),
onClick: () => {
cancelDownload(game.shop, game.objectId);
},
icon: <XCircleIcon />,
},
];