Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions frontend/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class Router {
return null;
}

navigate(name: RouteName, params: RouteParams = {}, resetParamCache = true): FullRouterState {
navigate(name: RouteName, params: RouteParams = {}, updatePathParamCache = true): FullRouterState {
const route = this.routes.find((route) => route.name === name);
if (!route) {
throw new Error(`Route with name ${name} not found`);
Expand All @@ -162,7 +162,7 @@ export class Router {
const query = Object.fromEntries(Object.entries(params).filter(([, v]) => v !== undefined));
const pathParams = { ...this.pathParamCache, ...query };

if (resetParamCache) {
if (updatePathParamCache) {
this.pathParamCache = {};
}

Expand All @@ -176,7 +176,9 @@ export class Router {
delete query[key];

params[key] = value;
this.pathParamCache[key] = value;
if (updatePathParamCache) {
this.pathParamCache[key] = value;
}

return value;
});
Expand Down
Loading