Just check once
This commit is contained in:
parent
cc5862ff4a
commit
a17df14dce
|
@ -95,20 +95,13 @@ 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 &&
|
contract.creatorId === user.id &&
|
||||||
contract.creatorId === user.id &&
|
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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user