fix: fixing sonar issues

This commit is contained in:
Chubby Granny Chaser
2025-01-22 10:02:05 +00:00
parent 4c5c602775
commit bfd54d5a3a
5 changed files with 20 additions and 22 deletions

View File

@@ -6,7 +6,7 @@ export interface DropdownMenuItem {
label: string;
disabled?: boolean;
show?: boolean;
onClick?: () => void;
onClick?: () => void | Promise<void>;
}
interface DropdownMenuProps {

View File

@@ -68,7 +68,7 @@ export function GameDetailsContextProvider({
objectId,
gameTitle,
shop,
}: GameDetailsContextProps) {
}: Readonly<GameDetailsContextProps>) {
const [shopDetails, setShopDetails] = useState<ShopDetails | null>(null);
const [achievements, setAchievements] = useState<UserAchievement[] | null>(
null
@@ -101,7 +101,7 @@ export function GameDetailsContextProvider({
const updateGame = useCallback(async () => {
return window.electron
.getGameByObjectId(shop, objectId!)
.getGameByObjectId(shop, objectId)
.then((result) => setGame(result));
}, [setGame, shop, objectId]);
@@ -194,7 +194,7 @@ export function GameDetailsContextProvider({
const lastDownloadedOption = useMemo(() => {
if (game?.download) {
const repack = repacks.find((repack) =>
repack.uris.some((uri) => uri.includes(game.download!.uri!))
repack.uris.some((uri) => uri.includes(game.download!.uri))
);
if (!repack) return null;
@@ -252,7 +252,7 @@ export function GameDetailsContextProvider({
value={{
game,
shopDetails,
shop: shop as GameShop,
shop,
repacks,
gameTitle,
isGameRunning,

View File

@@ -45,7 +45,7 @@ export function DownloadGroup({
openDeleteGameModal,
openGameInstaller,
seedingStatus,
}: DownloadGroupProps) {
}: Readonly<DownloadGroupProps>) {
const navigate = useNavigate();
const { t } = useTranslation("downloads");