Skip to content

Commit

Permalink
fix: avoid mdx duplicated paths on missing tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Feb 27, 2021
1 parent 13d65a2 commit cb2b94b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions core/routes/src/routes/docs-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,18 @@ export const getDocPages = (store: Store): DocPagesPath[] => {
: [undefined];
stories.forEach((storyId?: string) => {
const path = getStoryPath(storyId, doc, store, route);
docPaths.push({
lastModified: doc.dateModified
? new Date(doc.dateModified).toISOString()
: undefined,
path,
type: docType,
activeTab: route,
docId: doc.title,
storyId,
});
if (!docPaths.find(p => p.path === path)) {
docPaths.push({
lastModified: doc.dateModified
? new Date(doc.dateModified).toISOString()
: undefined,
path,
type: docType,
activeTab: route,
docId: doc.title,
storyId,
});
}
});
}
});
Expand Down

0 comments on commit cb2b94b

Please sign in to comment.