diff --git a/pastabble-frontend/src/lib/pages/Home.svelte b/pastabble-frontend/src/lib/pages/Home.svelte index e90c35a..bc4ee40 100644 --- a/pastabble-frontend/src/lib/pages/Home.svelte +++ b/pastabble-frontend/src/lib/pages/Home.svelte @@ -45,7 +45,10 @@ }); if(res.ok) { - const id = await res.text(); + let id = await res.text(); + if(id.includes('/')) { + id = id.substring(id.lastIndexOf('/') + 1); + } push(`/${id}`); } } @@ -75,7 +78,10 @@ }); if(res.status === 200) { - const id = await res.text(); + let id = await res.text(); + if(id.includes('/')) { + id = id.substring(id.lastIndexOf('/') + 1); + } createdUrl = `${location.origin}/to/${id}`; enteredUrl = ''; showAlert = true;