Skip to content

Commit 810697b

Browse files
committed
added game version popup also to web only
1 parent 63607ee commit 810697b

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

src/components/GameCard.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ export function GameCard({ game }: { game: GamevaultGame }) {
169169
);
170170

171171
const handleDirectDownload = useCallback(
172-
async (e: React.MouseEvent) => {
173-
e.preventDefault();
174-
e.stopPropagation();
172+
async () => {
175173
if (!serverUrl) return;
176174
await selectVersionAndRun("direct");
177175
},
@@ -206,9 +204,7 @@ export function GameCard({ game }: { game: GamevaultGame }) {
206204
);
207205

208206
const handleClientDownload = useCallback(
209-
async (e: React.MouseEvent) => {
210-
e.preventDefault();
211-
e.stopPropagation();
207+
async () => {
212208
await selectVersionAndRun("client");
213209
},
214210
[selectVersionAndRun],
@@ -320,10 +316,22 @@ export function GameCard({ game }: { game: GamevaultGame }) {
320316
<CloudArrowDownIcon className="w-6 h-6 fill-white" />
321317
</DropdownButton>
322318
<DropdownMenu className="min-w-48" anchor="top end">
323-
<DropdownItem onClick={handleDirectDownload}>
319+
<DropdownItem
320+
onClick={(e: React.MouseEvent) => {
321+
e.preventDefault();
322+
e.stopPropagation();
323+
void handleDirectDownload();
324+
}}
325+
>
324326
<DropdownLabel>Direct Download</DropdownLabel>
325327
</DropdownItem>
326-
<DropdownItem onClick={handleClientDownload}>
328+
<DropdownItem
329+
onClick={(e: React.MouseEvent) => {
330+
e.preventDefault();
331+
e.stopPropagation();
332+
void handleClientDownload();
333+
}}
334+
>
327335
<DropdownLabel>Download via GameVault Client</DropdownLabel>
328336
</DropdownItem>
329337
</DropdownMenu>

0 commit comments

Comments
 (0)