From d28a16d9382da81658e9c338932a3b05cf8a15fb Mon Sep 17 00:00:00 2001 From: Josef Date: Tue, 2 Jul 2024 22:06:04 +0200 Subject: [PATCH] fix: trim trailing slash from custom rpc url (#58) * fix: trim trailing slash from custom rpc url * fix: merge frontend url correctly --- .../src/shared/components/default-frontend-form/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/extension/src/shared/components/default-frontend-form/index.tsx b/apps/extension/src/shared/components/default-frontend-form/index.tsx index 596d8dfd..1c766ffd 100644 --- a/apps/extension/src/shared/components/default-frontend-form/index.tsx +++ b/apps/extension/src/shared/components/default-frontend-form/index.tsx @@ -22,7 +22,11 @@ const getFrontendsFromRegistry = (selectedRpc?: string): DisplayedFrontend[] => })); if (selectedRpc) { - registeredFrontends.push({ title: 'Embedded RPC frontend', url: `${selectedRpc}/app/` }); + registeredFrontends.push({ + title: 'Embedded RPC frontend', + /*NB: we merge using the variadic URL constructor here to avoid double-slashes*/ + url: new URL('/app/', selectedRpc).href, + }); } return registeredFrontends;