Skip to content

Commit

Permalink
stay on batch operations page when switching namespaces (#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossedfort authored Oct 11, 2023
1 parent 4120b5f commit a9507ad
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,24 @@
};
function getCurrentHref(namespace: string) {
const onSchedulesPage = $page.url.pathname.endsWith('schedules');
const href = onSchedulesPage
? routeForSchedules({ namespace })
: routeForWorkflows({ namespace });
return href;
const namespacePages = [
{
subPath: 'schedules',
fullRoute: routeForSchedules({ namespace }),
},
{
subPath: 'batch-operations',
fullRoute: routeForBatchOperations({ namespace }),
},
];
for (const { subPath, fullRoute } of namespacePages) {
if ($page.url.pathname.endsWith(subPath)) {
return fullRoute;
}
}
return routeForWorkflows({ namespace });
}
const logout = () => {
Expand Down

0 comments on commit a9507ad

Please sign in to comment.