Skip to content

Commit

Permalink
Fix Canvas nav link in env with spaces (#67127)
Browse files Browse the repository at this point in the history
  • Loading branch information
poffdeluxe authored May 21, 2020
1 parent 0fd96e4 commit 484e0a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions x-pack/plugins/canvas/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ export class CanvasPlugin
this.srcPlugin.setup(core, { canvas: canvasApi });

// Set the nav link to the last saved url if we have one in storage
const lastUrl = getSessionStorage().get(SESSIONSTORAGE_LASTPATH);
if (lastUrl) {
const lastPath = getSessionStorage().get(
`${SESSIONSTORAGE_LASTPATH}:${core.http.basePath.get()}`
);
if (lastPath) {
this.appUpdater.next(() => ({
defaultPath: `#${lastUrl}`,
defaultPath: `#${lastPath}`,
}));
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/services/nav_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const navLinkServiceFactory: CanvasServiceFactory<NavLinkService> = (
defaultPath: `#${path}`,
}));

getSessionStorage().set(SESSIONSTORAGE_LASTPATH, path);
getSessionStorage().set(`${SESSIONSTORAGE_LASTPATH}:${coreSetup.http.basePath.get()}`, path);
},
};
};

0 comments on commit 484e0a9

Please sign in to comment.