Just check once

This commit is contained in:
Ian Philips 2022-04-28 15:29:06 -06:00
parent cc5862ff4a
commit a17df14dce

View File

@ -95,7 +95,6 @@ export function ContractPageContent(props: FirstArgument<typeof ContractPage>) {
const [showConfetti, setShowConfetti] = useState(false) const [showConfetti, setShowConfetti] = useState(false)
useEffect(() => { useEffect(() => {
const timer = setInterval(() => {
const shouldSeeConfetti = !!( const shouldSeeConfetti = !!(
user && user &&
contract && contract &&
@ -103,12 +102,6 @@ export function ContractPageContent(props: FirstArgument<typeof ContractPage>) {
Date.now() - contract.createdTime < 10 * 1000 Date.now() - contract.createdTime < 10 * 1000
) )
setShowConfetti(shouldSeeConfetti) setShowConfetti(shouldSeeConfetti)
// Don't erase confetti mid-animation
if (shouldSeeConfetti) clearInterval(timer)
}, 1000)
return () => {
clearInterval(timer)
}
}, [contract, user]) }, [contract, user])
// Sort for now to see if bug is fixed. // Sort for now to see if bug is fixed.