Skip to content

Commit

Permalink
fix(web): type error in sparkles.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kriptonian1 committed Mar 31, 2024
1 parent f551ddb commit 65c7f81
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions apps/web/src/components/ui/sparkles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,29 @@ export function SparklesCore(props: ParticlesProps): React.JSX.Element {
}, [])
const controls = useAnimation()

const particlesLoaded = (container?: Container): void => {
if (container) {
void controls.start({
opacity: 1,
transition: {
duration: 1
}
})
}
const particlesLoaded = (
container?: Container | undefined
): Promise<void> => {
return new Promise((resolve, reject) => {
if (container) {
controls
.start({
opacity: 1,
transition: {
duration: 1
}
})
.then(() => {
resolve()
})
.catch((error) => {
console.error('Error starting animation: ', error)
reject(new Error(`${error}`))
})
} else {
resolve()
}
})
}

return (
Expand Down

0 comments on commit 65c7f81

Please sign in to comment.