Skip to content

Commit

Permalink
Merge pull request #22631 from SpookyJelly/patch-1
Browse files Browse the repository at this point in the history
Core: Fix `useStoryPrepared` hook failing with `undefined` data
  • Loading branch information
JReinhold authored Nov 22, 2023
2 parents e0509fe + 29facdd commit 6166ab4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/lib/manager-api/src/modules/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ export const init: ModuleFn<SubAPI, SubState> = ({
},
isPrepared: (storyId, refId) => {
const data = api.getData(storyId, refId);
if (!data) {
return false;
}
return data.type === 'story' ? data.prepared : true;
},
resolveStory: (storyId, refId) => {
Expand Down

0 comments on commit 6166ab4

Please sign in to comment.