From 941808a67a3cc3a72fde4d7aafc0c5abb90f5488 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Sat, 2 Nov 2024 01:01:52 -0400 Subject: [PATCH] Only encode path of url --- app/routes/short-links.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/routes/short-links.tsx b/app/routes/short-links.tsx index 85f0372..d61a6a9 100644 --- a/app/routes/short-links.tsx +++ b/app/routes/short-links.tsx @@ -103,17 +103,17 @@ export default function () { return ( {entry.destination} - { - navigator.clipboard.writeText( - encodeURIComponent( - `https://carcrushe.rs/${entry.path}`, - ), - ); - alert("Link copied"); - }} - > - https://carcrushe.rs/{entry.path} + + { + await navigator.clipboard.writeText( + `https://carcrushe.rs/${encodeURIComponent(entry.path)}`, + ); + alert("Link copied"); + }} + > + https://carcrushe.rs/{entry.path} +