Don't show bets streak modal on navigate each tab
This commit is contained in:
parent
39c312cf9f
commit
b67a26ad61
|
@ -70,10 +70,25 @@ export function UserPage(props: { user: User }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const claimedMana = router.query['claimed-mana'] === 'yes'
|
const claimedMana = router.query['claimed-mana'] === 'yes'
|
||||||
setShowConfetti(claimedMana)
|
|
||||||
const showBettingStreak = router.query['show'] === 'betting-streak'
|
const showBettingStreak = router.query['show'] === 'betting-streak'
|
||||||
setShowBettingStreakModal(showBettingStreak)
|
setShowBettingStreakModal(showBettingStreak)
|
||||||
}, [router])
|
setShowConfetti(claimedMana || showBettingStreak)
|
||||||
|
|
||||||
|
const query = { ...router.query }
|
||||||
|
if (query.claimedMana || query.show) {
|
||||||
|
delete query['claimed-mana']
|
||||||
|
delete query['show']
|
||||||
|
router.replace(
|
||||||
|
{
|
||||||
|
pathname: router.pathname,
|
||||||
|
query,
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
{ shallow: true }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [])
|
||||||
|
|
||||||
const profit = user.profitCached.allTime
|
const profit = user.profitCached.allTime
|
||||||
|
|
||||||
|
@ -84,10 +99,9 @@ export function UserPage(props: { user: User }) {
|
||||||
description={user.bio ?? ''}
|
description={user.bio ?? ''}
|
||||||
url={`/${user.username}`}
|
url={`/${user.username}`}
|
||||||
/>
|
/>
|
||||||
{showConfetti ||
|
{showConfetti && (
|
||||||
(showBettingStreakModal && (
|
|
||||||
<FullscreenConfetti recycle={false} numberOfPieces={300} />
|
<FullscreenConfetti recycle={false} numberOfPieces={300} />
|
||||||
))}
|
)}
|
||||||
<BettingStreakModal
|
<BettingStreakModal
|
||||||
isOpen={showBettingStreakModal}
|
isOpen={showBettingStreakModal}
|
||||||
setOpen={setShowBettingStreakModal}
|
setOpen={setShowBettingStreakModal}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user