parent
6a8dd23d29
commit
45f6c32eb6
6 changed files with 17 additions and 23 deletions
|
@ -32,9 +32,9 @@ const TIMEOUT = 1500;
|
|||
export function UseCaseSelection({ onFinished }: Props) {
|
||||
const [selection, setSelected] = useState<UseCase | null>(null);
|
||||
|
||||
// Call onFinished 1.5s after `selection` becomes truthy, to give time for the animation to run
|
||||
useEffect(() => {
|
||||
if (selection) {
|
||||
setSelected(selection);
|
||||
let handler: number | null = setTimeout(() => {
|
||||
handler = null;
|
||||
onFinished(selection);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue