Skip to content

Commit

Permalink
Fix invalid redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
KSH-code authored Jun 12, 2024
1 parent 6de6bfe commit ad5fde5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad5fde5

Please sign in to comment.