Skip to content

Commit 2f8d01d

Browse files
valentinpalkovicstorybook-bot
authored andcommitted
Merge pull request #33686 from JSMike/33548-fix-base-path
Manager: Update logic to use base path instead of full pathname (cherry picked from commit 7ab7f41)
1 parent 439af85 commit 2f8d01d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • code/core/src/manager-api/modules

code/core/src/manager-api/modules/refs.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ export const getSourceType = (source: string, refId?: string) => {
8181
const { origin: localOrigin, pathname: localPathname } = location;
8282
const { origin: sourceOrigin, pathname: sourcePathname } = new URL(source);
8383

84-
const localFull = `${localOrigin + localPathname}`.replace('/iframe.html', '').replace(/\/$/, '');
85-
const sourceFull = `${sourceOrigin + sourcePathname}`
86-
.replace('/iframe.html', '')
87-
.replace(/\/$/, '');
84+
const localFull = `${localOrigin + localPathname}`.replace(/\/[^\/]*$/, '');
85+
const sourceFull = `${sourceOrigin + sourcePathname}`.replace(/\/[^\/]*$/, '');
8886

8987
if (localFull === sourceFull) {
9088
return ['local', sourceFull];

0 commit comments

Comments
 (0)