diff --git a/x-pack/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx index c2192818e528b..1265bfbb69b70 100644 --- a/x-pack/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -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}`, })); } diff --git a/x-pack/plugins/canvas/public/services/nav_link.ts b/x-pack/plugins/canvas/public/services/nav_link.ts index 5061498458006..68d685242351b 100644 --- a/x-pack/plugins/canvas/public/services/nav_link.ts +++ b/x-pack/plugins/canvas/public/services/nav_link.ts @@ -25,7 +25,7 @@ export const navLinkServiceFactory: CanvasServiceFactory = ( defaultPath: `#${path}`, })); - getSessionStorage().set(SESSIONSTORAGE_LASTPATH, path); + getSessionStorage().set(`${SESSIONSTORAGE_LASTPATH}:${coreSetup.http.basePath.get()}`, path); }, }; };