From e6638afa3c8353ce49cdb39407cea834a9c7d16a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 18 Nov 2021 21:33:49 +0100 Subject: [PATCH] web: remove manually URL encoded paths Signed-off-by: Jens Langhammer --- web/src/interfaces/AdminInterface.ts | 4 +++- web/src/interfaces/UserInterface.ts | 4 +++- web/src/pages/flows/FlowListPage.ts | 4 +++- web/src/pages/flows/FlowViewPage.ts | 6 +++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/web/src/interfaces/AdminInterface.ts b/web/src/interfaces/AdminInterface.ts index 50a94b19d..b8aa7a1a0 100644 --- a/web/src/interfaces/AdminInterface.ts +++ b/web/src/interfaces/AdminInterface.ts @@ -167,7 +167,9 @@ export class AdminInterface extends LitElement { return html` ${t`You're currently impersonating ${u.user.username}. Click to stop.`} ${t`Stop impersonation`} diff --git a/web/src/pages/flows/FlowListPage.ts b/web/src/pages/flows/FlowListPage.ts index 41ddc28e6..f1477f864 100644 --- a/web/src/pages/flows/FlowListPage.ts +++ b/web/src/pages/flows/FlowListPage.ts @@ -114,7 +114,9 @@ export class FlowListPage extends TablePage { }) .then((link) => { window.open( - `${link.link}?inspector&next=/%23${window.location.href}`, + `${link.link}?inspector&next=${encodeURIComponent( + `/#${window.location.href}`, + )}`, ); }); }} diff --git a/web/src/pages/flows/FlowViewPage.ts b/web/src/pages/flows/FlowViewPage.ts index a20c45f45..0610df81a 100644 --- a/web/src/pages/flows/FlowViewPage.ts +++ b/web/src/pages/flows/FlowViewPage.ts @@ -119,7 +119,11 @@ export class FlowViewPage extends LitElement { slug: this.flow.slug, }) .then((link) => { - const finalURL = `${link.link}?inspector&next=/%23${window.location.hash}`; + const finalURL = `${ + link.link + }?${encodeURI( + `inspector&next=/#${window.location.hash}`, + )}`; window.open(finalURL, "_blank"); }); }}