Skip to content

Commit

Permalink
fix: fixing sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Jan 22, 2025
1 parent dcd1634 commit 93fc486
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/components/dropdown-menu/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface DropdownMenuItem {
label: string;
disabled?: boolean;
show?: boolean;
onClick?: () => void | Promise<void>;
onClick?: () => void;
}

interface DropdownMenuProps {
Expand All @@ -29,7 +29,7 @@ export function DropdownMenu({
loop = true,
align = "center",
alignOffset = 0,
}: DropdownMenuProps) {
}: Readonly<DropdownMenuProps>) {
return (
<DropdownMenuPrimitive.Root>
<DropdownMenuPrimitive.Trigger asChild>
Expand Down
32 changes: 24 additions & 8 deletions src/renderer/src/pages/downloads/download-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 />,
},
{
Expand All @@ -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"),
Expand All @@ -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);
},
},
];
}
Expand All @@ -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 />,
},
];
Expand All @@ -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 />,
},
];
Expand Down

0 comments on commit 93fc486

Please sign in to comment.