From 88f4aa4a5b0f42cd061498c9726fb4b8895ff007 Mon Sep 17 00:00:00 2001
From: Kit La Touche <kit@transneptune.net>
Date: Sat, 4 Jan 2025 17:58:17 -0500
Subject: Fix invite copy button

---
 ui/lib/components/Invite.svelte | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'ui/lib/components/Invite.svelte')

diff --git a/ui/lib/components/Invite.svelte b/ui/lib/components/Invite.svelte
index ce45930..9e6e469 100644
--- a/ui/lib/components/Invite.svelte
+++ b/ui/lib/components/Invite.svelte
@@ -3,7 +3,11 @@
 
   let { id } = $props();
   let inviteUrl = $derived(new URL(`/invite/${id}`, document.location));
+  // Nota bene: we cannot use:copy={inviteUrl}, because inviteUrl is not a
+  // string, and therefore will get treated as an options object. So we must
+  // explicitly build an options object, containing the value that will
+  // eventually be interpreted as a string.
 </script>
 
-<button use:copy={inviteUrl}>copy</button>
+<button use:copy={{ text: inviteUrl }}>copy</button>
 <span>{inviteUrl}</span>
-- 
cgit v1.2.3

