Skip to content

Commit

Permalink
fix: page not found error
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Apr 8, 2024
1 parent 5602f14 commit 7048e9c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/core/public/application/application_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,23 @@ export class ApplicationService {
const currentAppId = this.currentAppId$.value;
const navigatingToSameApp = currentAppId === appId;
const shouldNavigate = navigatingToSameApp ? true : await this.shouldNavigate(overlays);
const targetApp = applications$.value.get(appId);
if (
workspaces.currentWorkspaceId$.value &&
targetApp?.visibility === AppVisibility.homeOnly
) {
// If user is inside a workspace and the target app is homeOnly
// refresh the page by doing a hard navigation
window.location.assign(getAppUrl(availableMounters, appId, path));
return;
}

if (shouldNavigate) {
const targetApp = applications$.value.get(appId);
if (
workspaces.currentWorkspaceId$.value &&
targetApp?.visibility === AppVisibility.homeOnly
) {
// If user is inside a workspace and the target app is homeOnly
// refresh the page by doing a hard navigation
window.location.assign(
http.basePath.prepend(getAppUrl(availableMounters, appId, path), {
withoutClientBasePath: true,
})
);
return;
}

if (path === undefined) {
path = applications$.value.get(appId)?.defaultPath;
}
Expand Down

0 comments on commit 7048e9c

Please sign in to comment.