From f71bfcfb66ee19701c118d482ad40a9eaeb1a884 Mon Sep 17 00:00:00 2001
From: Josh Creek <8179928+jcreek@users.noreply.github.com>
Date: Wed, 12 Jul 2023 11:59:01 +0000
Subject: [PATCH] feat(*): Add share room link button
---
src/routes/estimation/[roomId]/+page.svelte | 32 +++++++++++++++++++--
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/routes/estimation/[roomId]/+page.svelte b/src/routes/estimation/[roomId]/+page.svelte
index b226aae..14cbe93 100644
--- a/src/routes/estimation/[roomId]/+page.svelte
+++ b/src/routes/estimation/[roomId]/+page.svelte
@@ -142,14 +142,21 @@
onMount(() => {
socket = connectToWebSocket(data.roomId, onMessageReceived);
});
+
+ async function copyToClipboard() {
+ try {
+ await navigator.clipboard.writeText(window.location.href);
+ alert('Room link copied to clipboard!');
+ } catch (err) {
+ console.error('Failed to copy: ', err);
+ }
+ }
{#if showModal}