From dcdb3839601ac094b3e39ea0901388ded1bea507 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 2 Feb 2023 21:43:24 +0100 Subject: [PATCH] fix: share url on subpath fixes https://github.com/tidalcycles/strudel/issues/389 --- website/src/repl/Repl.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/repl/Repl.jsx b/website/src/repl/Repl.jsx index 5c3623bd..b26f2bbc 100644 --- a/website/src/repl/Repl.jsx +++ b/website/src/repl/Repl.jsx @@ -222,10 +222,10 @@ export function Repl({ embedded = false }) { } // generate uuid in the browser const hash = nanoid(12); + const shareUrl = window.location.origin + window.location.pathname + '?' + hash; const { data, error } = await supabase.from('code').insert([{ code: codeToShare, hash }]); if (!error) { setLastShared(activeCode || code); - const shareUrl = window.location.origin + '?' + hash; // copy shareUrl to clipboard await navigator.clipboard.writeText(shareUrl); const message = `Link copied to clipboard: ${shareUrl}`;