Skip to content

Commit

Permalink
fix(TDC-7496/tour): Reset currentStep to 0 when tour is reopened (#5322)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbhong authored May 31, 2024
1 parent 31ce4e7 commit 50801bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-bikes-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@talend/react-components": patch
---

Reset currentStep to 0 when tour is reopened
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ function AppGuidedTour({
const [isAlreadyViewed, setIsAlreadyViewed] = useLocalStorage(localStorageKey, false);
const [importDemoContent, setImportDemoContent] = useState(demoContentSteps && !isAlreadyViewed);
const [currentStep, setCurrentStep] = useState(0);
// Reset currentStep to 0 when tour is opened
useEffect(() => {
if (isOpen) {
setCurrentStep(0);
}
}, [isOpen]);

const isNavigationDisabled =
importDemoContent &&
Expand Down

0 comments on commit 50801bd

Please sign in to comment.