diff --git a/templates/src/client/app.ts b/templates/src/client/app.ts index 43b0764..09382bd 100644 --- a/templates/src/client/app.ts +++ b/templates/src/client/app.ts @@ -217,6 +217,10 @@ export function prepare_page(target: Target): Promise<{ segments[changed_from] === new_segments[changed_from] ) changed_from += 1; + if (changed_from === new_segments.length) { + changed_from -= 1; + } + let redirect: Redirect = null; let error: { statusCode: number, message: Error | string } = null; @@ -383,4 +387,4 @@ function detach(node: Node) { function changed(a: Record, b: Record) { return JSON.stringify(a) !== JSON.stringify(b); -} \ No newline at end of file +}