Skip to content

Commit 0de7115

Browse files
committed
fix: review
1 parent de395f2 commit 0de7115

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/routes.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ export function createHref(
8686
extendedQuery = {...extendedQuery, clusterName};
8787
}
8888

89-
//if {environment: undefinded} in params - it meant we want to reset it
90-
if (webVersion && environment && !('environment' in extendedParams)) {
89+
//if {environment: ""} in params - it meant we want to reset it
90+
const isEnvironmentInParams = typeof params?.environment === 'string';
91+
92+
if (webVersion && environment && !isEnvironmentInParams) {
9193
extendedParams = {...extendedParams, environment};
9294
}
9395

@@ -140,8 +142,9 @@ export function getStorageGroupPath(groupId: string | number, query: Query = {})
140142
export function getDefaultNodePath(
141143
params: {id: string | number; activeTab?: NodeTab},
142144
query: NodePageQuery = {},
145+
options?: CreateHrefOptions,
143146
) {
144-
return createHref(routes.node, params, query);
147+
return createHref(routes.node, params, query, options);
145148
}
146149

147150
export const getClusterPath = (

src/utils/parseBalancer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function prepareBackendFromBalancer(rawBalancer: string) {
7070
const metaBackend = window.meta_backend;
7171
const envPrefix = environment ? `/${environment}` : '';
7272

73-
// If meta_backend is a full URL (has protocol), don't add leading slash
73+
// If meta_backend is a full URL (has protocol), don't add environment prefix
7474
if (protocolRegex.test(metaBackend)) {
7575
return normalizePathSlashes(`${metaBackend}/${preparedBalancer}`);
7676
}

0 commit comments

Comments
 (0)