From 132ad44c0897ad0d480b710ea4759fb89b42c892 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Thu, 15 Aug 2024 16:03:06 -0400 Subject: [PATCH] Make public from creation modal --- frontend/src/lib/components/NewAdventure.svelte | 17 +++++++++++++++++ frontend/src/routes/adventures/+page.server.ts | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/frontend/src/lib/components/NewAdventure.svelte b/frontend/src/lib/components/NewAdventure.svelte index a18d80c3..48268a4d 100644 --- a/frontend/src/lib/components/NewAdventure.svelte +++ b/frontend/src/lib/components/NewAdventure.svelte @@ -125,6 +125,9 @@ let user_id = data[2]; let image_url = data[3]; let link = data[4]; + if (newAdventure.is_public) { + navigator.clipboard.writeText(`${window.location.origin}/adventures/${id}`); + } newAdventure.image = image_url; newAdventure.id = id; newAdventure.user_id = user_id; @@ -370,6 +373,20 @@ class="input input-bordered w-full max-w-xs mt-1" /> +
+
+ +
+ {#if newAdventure.is_public} +

The link to this adventure will be copied to your clipboard once it is created!

+ {/if}