Skip to content

Commit

Permalink
prevent not-found hash
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Jul 26, 2024
1 parent eb832b1 commit 286b75e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/website/components/Demos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default function Demos({ demos }: { demos: Demo[] }) {
);
if (currentIndex !== -1) {
setDemoIndex(currentIndex);
} else {
setHash(demos[demoIndex].name); // not found hash => fallback to default demo
}
}, [demoIndex, demos, hash, setHash]);

Expand Down

0 comments on commit 286b75e

Please sign in to comment.