Copy the full giftcard URL in the credits dialog

This commit is contained in:
Alex Gleason committed 2025-10-30 12:23:10 -05:00
1 parent 0b2003d9f8
commit 5084353afe
1 file changed
+8 -1
+8 -1
View File
@@ -554,7 +554,14 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
};
const handleCopyCode = (code: string) => {
navigator.clipboard.writeText(code);
// Create the full shareable URL for the gift card
const url = new URL('/giftcard', window.location.origin);
url.hash = new URLSearchParams({
baseURL: provider.baseURL,
code: code,
}).toString();
navigator.clipboard.writeText(url.toString());
setCopiedCode(code);
setTimeout(() => setCopiedCode(null), 2000);
};