Skip to content

Commit

Permalink
fix(story): prevent returning of different story
Browse files Browse the repository at this point in the history
  • Loading branch information
BJvdA committed May 10, 2021
1 parent 3118760 commit 7e7f6bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bridge/useStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ export const useStory = (newStory: Story) => {
context?.setStory(newStory);
}, [newStory]);

return context?.story === undefined ? newStory : context?.story;
return context?.story === undefined || newStory?.uuid !== context?.story?.uuid
? newStory
: context?.story;
};

1 comment on commit 7e7f6bb

@vercel
Copy link

@vercel vercel bot commented on 7e7f6bb May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.