Skip to content

Commit

Permalink
fix: dynamic story paths
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Nov 14, 2020
1 parent 0db0234 commit 7dff541
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/core/src/document-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ export const getStoryPath = (
const docRoute = removeTrailingSlash(doc?.route || basePath);
const story = store?.stories[storyId];
const { dynamicId, name } = story || {};
const route = `${docRoute}${
!dynamicId && storyId ? ensureStartingSlash(storyId) : ''
}${activeTab ? ensureStartingSlash(activeTab) : ''}${
dynamicId ? `?story=${name}` : ''
}`;
const id = dynamicId || storyId;
const route = `${docRoute}${id ? ensureStartingSlash(id) : ''}${
activeTab ? ensureStartingSlash(activeTab) : ''
}${dynamicId ? `?story=${name}` : ''}`;
return encodeURI(`${siteRoot}${route}`);
};

Expand Down

0 comments on commit 7dff541

Please sign in to comment.