Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions blocks/shared/pathDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,16 @@ export default function getPathDetails(loc) {
const { pathname, hash: tmpHash } = loc || window.location;
if (!pathname || !tmpHash) return undefined;

// config, edit, sheet
const editor = getView(pathname);

// There can be non-ideal pieces in the hash (old_hash, access_token)
const parts = tmpHash.split('#');
const hashPath = parts.find((part) => part.startsWith('/'));

// If there's not a hash path, return undefined
if (!hashPath) return undefined;
const hash = `#${hashPath}`;
const hash = `#${hashPath}${editor === 'config' && !hashPath.endsWith('/') ? '/' : ''}`;

// Use cached details if the hash has not changed
if (currhash === hash && currpath === pathname && details) return details;
Expand All @@ -120,9 +123,6 @@ export default function getPathDetails(loc) {
const fullpath = hash.replace('#', '');
window.name = fullpath;

// config, edit, sheet
const editor = getView(pathname);

// IMS redirect fragments appear as '/ld_hash=', '/old_hash=', '/access_token=' in the path.
// fullpath always starts with '/' here, so strip it before the prefix check.
const pathContent = fullpath.slice(1);
Expand Down
Loading