From b22db6d059d357f6507c76b2d78effa5bc39716a Mon Sep 17 00:00:00 2001 From: Henry Kim Date: Wed, 12 Jun 2024 17:59:27 +0900 Subject: [PATCH] Fix invalid redirection fix #564 Signed-off-by: ksh-code --- src/components/navigation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/navigation.ts b/src/components/navigation.ts index f60743d2..24720dc7 100644 --- a/src/components/navigation.ts +++ b/src/components/navigation.ts @@ -14,7 +14,9 @@ export class NavigationManager implements NavigationApi { } public goto(path: string, query: {[name: string]: any} = {}, options?: { event?: React.MouseEvent, replace?: boolean }): void { - if (path.startsWith('.')) { + if (path.startsWith('./') && this.history.location.pathname.endsWith('/')) { + path = this.history.location.pathname + path.slice(2); + } else if (path.startsWith('.')) { path = this.history.location.pathname + path.slice(1); } const noPathChange = path === this.history.location.pathname;