Skip to content

Commit

Permalink
fix: Storyly when closed with a previous action
Browse files Browse the repository at this point in the history
  • Loading branch information
KVNLS committed Jun 16, 2024
1 parent 3581d4b commit 4bd2755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-pans-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

Fix Storyly when it's closed with a previous action
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ const StorylyProvider: React.FC<StorylyProviderProps> = ({ children }) => {
};

const handleEvent = (e: Storyly.StoryEvent) => {
if (e.event === "StoryGroupClosed" || e.event === "StoryGroupCompleted") clear();
if (["StoryGroupClosed", "StoryGroupCompleted", "StoryPaused"].includes(e.event)) {
clear();
}
if (e.event === "StoryCTAClicked" && e?.story?.media?.actionUrl) {
Linking.openURL(e.story.media.actionUrl);
storylyRef.current?.close?.();
clear();
}
};

Expand Down

0 comments on commit 4bd2755

Please sign in to comment.