Skip to content

Commit

Permalink
feat: set help steps to start when close help modal
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Sep 24, 2024
1 parent f68f261 commit e1b6048
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/HelpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Tabs,
} from '@nextui-org/react';
import { AnimatePresence, motion } from 'framer-motion';
import { useState } from 'react';
import { useEffect, useState } from 'react';

import { useHelpModal } from '../helpers/help-modal';

Expand Down Expand Up @@ -85,6 +85,13 @@ export const HelpModal = () => {
}),
};

useEffect(() => {
if (!helpModal.isOpen) {
setStepIndex(0);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [helpModal.isOpen]);

const step = STEPS[stepIndex];

return (
Expand Down

0 comments on commit e1b6048

Please sign in to comment.