Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
440 B · 18 lines
TypeScript
at main
12345678910111213141516171819import React from 'react'
import {type DialogControlProps} from '#/components/Dialog/types'
export function useAutoOpen(control: DialogControlProps, showTimeout?: number) { React.useEffect(() => { if (showTimeout) { const timeout = setTimeout(() => { control.open() }, showTimeout) return () => { clearTimeout(timeout) } } else { control.open() } }, [control, showTimeout])}