Fix Canvas nav link in env with spaces (#67127)

This commit is contained in:
Poff Poffenberger 2020-05-21 08:54:25 -05:00 committed by GitHub
parent 0fd96e4d01
commit 484e0a99ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -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}`,
}));
}

View file

@ -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);
},
};
};