Skip to content

Commit

Permalink
fix navigation url bug
Browse files Browse the repository at this point in the history
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
  • Loading branch information
yuye-aws committed Jul 21, 2023
1 parent dc4ed96 commit b1cec66
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { DeleteWorkspaceModal } from '../delete_workspace_modal';

export const WorkspaceUpdater = () => {
const {
services: { application, workspaces, notifications, http },
services: { application, workspaces, notifications },
} = useOpenSearchDashboards<{ application: ApplicationStart }>();

const currentWorkspace = useObservable(
Expand Down Expand Up @@ -127,14 +127,13 @@ export const WorkspaceUpdater = () => {
}
}
setDeleteWorkspaceModalVisible(false);
if (http) {
await application.navigateToUrl(
http.basePath.remove(
application.getUrlForApp('home', {
path: '',
absolute: false,
})
)
if (workspaces) {
window.location.href = workspaces.formatUrlWithWorkspaceId(
application.getUrlForApp('home', {
path: '/',
absolute: true,
}),
''
);
}
};
Expand All @@ -161,14 +160,13 @@ export const WorkspaceUpdater = () => {
});
return;
}
if (http) {
await application.navigateToUrl(
http.basePath.remove(
application.getUrlForApp('home', {
path: '',
absolute: false,
})
)
if (workspaces) {
window.location.href = workspaces.formatUrlWithWorkspaceId(
application.getUrlForApp('home', {
path: '/',
absolute: true,
}),
''
);
}
};
Expand Down

0 comments on commit b1cec66

Please sign in to comment.