Skip to content

Commit

Permalink
Reduce version calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
indigolain committed Mar 15, 2024
1 parent 2010922 commit b5874d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/storycrawler/src/browser/stories-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ export class StoriesBrowser extends BaseBrowser {
}
return;
}
const version = isPreviewApi(api) ? 'v8' : 'v5';
const stories = (
isPreviewApi(api) && api.storyStoreValue
? Object.values(api.storyStoreValue.extract())
: api.raw
? api.raw()
: []
).map(_ => ({ id: _.id, kind: _.kind, story: _.name, version: isPreviewApi(api) ? 'v8' : 'v5' } as Story));
).map(_ => ({ id: _.id, kind: _.kind, story: _.name, version } as Story));
res({ stories, timeout: false });
};
getStories();
Expand Down

0 comments on commit b5874d3

Please sign in to comment.