From e61071007e366d72cb374c519339a28b08d9da57 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Wed, 20 May 2026 02:23:09 +0800 Subject: [PATCH] feat: share button uses steamAppId/slug instead of UUID --- app/game/[id]/game-page-client.tsx | 4 ++++ app/game/[id]/preset-detail-modal.tsx | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/game/[id]/game-page-client.tsx b/app/game/[id]/game-page-client.tsx index 8957441..82d63e2 100644 --- a/app/game/[id]/game-page-client.tsx +++ b/app/game/[id]/game-page-client.tsx @@ -61,6 +61,7 @@ interface Game { capsuleImage: string | null storeUrl: string | null source: string + slug: string | null lastSync: string | null syncStatus: string | null createdAt: string @@ -1901,6 +1902,9 @@ export function GamePageClient({ void onDelete: (presetId: string) => void onReport: ( @@ -140,6 +143,9 @@ function hasGameInfoData(p: Preset): boolean { export function PresetDetailModal({ preset, gameId, + gameSource, + gameSteamAppId, + gameSlug, onClose, onDelete, onReport, @@ -169,7 +175,15 @@ export function PresetDetailModal({ const isAuthenticated = !!session?.user const handleShare = () => { - const url = `${window.location.origin}/game/${gameId}?preset=${preset.id}` + let identifier: string + if (gameSource === "steam" && gameSteamAppId != null) { + identifier = String(gameSteamAppId) + } else if (gameSlug) { + identifier = gameSlug + } else { + identifier = gameId // fallback for edge cases + } + const url = `${window.location.origin}/game/${identifier}?preset=${preset.id}` navigator.clipboard.writeText(url) setCopied(true) setTimeout(() => setCopied(false), 2000)