mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
fix: resolve undefined cluster context in navigation (#639)
* fix: resolve undefined cluster context in navigation * fix: encode cluster context and resolve linting failures
This commit is contained in:
@@ -21,9 +21,12 @@ function RepositoryPage() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleRepositoryChanged = (selectedRepository: Repository) => {
|
const handleRepositoryChanged = (selectedRepository: Repository) => {
|
||||||
void navigateTo(`/repository/${selectedRepository.name}`, {
|
void navigateTo(
|
||||||
replace: true,
|
context
|
||||||
});
|
? `/${encodeURIComponent(context)}/repository/${selectedRepository.name}`
|
||||||
|
: `/repository/${selectedRepository.name}`,
|
||||||
|
{ replace: true }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -34,9 +37,12 @@ function RepositoryPage() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedRepo && !repoFromParams) {
|
if (selectedRepo && !repoFromParams) {
|
||||||
void navigateTo(`/repository/${selectedRepo}`, {
|
void navigateTo(
|
||||||
replace: true,
|
context
|
||||||
});
|
? `/${encodeURIComponent(context)}/repository/${selectedRepo}`
|
||||||
|
: `/repository/${selectedRepo}`,
|
||||||
|
{ replace: true }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}, [selectedRepo, repoFromParams, context, navigateTo]);
|
}, [selectedRepo, repoFromParams, context, navigateTo]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user