Skip to content

Commit

Permalink
Added delay for sending discord notfication and re-routing
Browse files Browse the repository at this point in the history
  • Loading branch information
namedotget committed Dec 12, 2024
1 parent 354ccc1 commit 2380100
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions ui/components/onboarding/CreateCitizen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,16 @@ export default function CreateCitizen({
citizenName,
mintedTokenId
)
await sendDiscordMessage(
accessToken,
'networkNotifications',
`[**${citizenName}** has minted a citizen NFT!](${DEPLOYED_ORIGIN}/citizen/${citizenPrettyLink}?_timestamp=123456789)`
)
setTimeout(async () => {
await sendDiscordMessage(
accessToken,
'networkNotifications',
`[**${citizenName}** has minted a citizen NFT!](${DEPLOYED_ORIGIN}/citizen/${citizenPrettyLink}?_timestamp=123456789)`
)

router.push(`/citizen/${citizenPrettyLink}`)
setIsLoadingMint(false)
router.push(`/citizen/${citizenPrettyLink}`)
setIsLoadingMint(false)
}, 5000)
}
} catch (err) {
console.error(err)
Expand Down
16 changes: 9 additions & 7 deletions ui/components/onboarding/CreateTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,16 @@ export default function CreateTeam({
)
const teamName = teamNFT?.metadata.name as string
const teamPrettyLink = generatePrettyLink(teamName)
await sendDiscordMessage(
accessToken,
'networkNotifications',
`[**${teamName}** has minted a team NFT!](${DEPLOYED_ORIGIN}/team/${teamPrettyLink}?_timestamp=123456789)`
)
setTimeout(async () => {
await sendDiscordMessage(
accessToken,
'networkNotifications',
`[**${teamName}** has minted a team NFT!](${DEPLOYED_ORIGIN}/team/${teamPrettyLink}?_timestamp=123456789)`
)

router.push(`/team/${mintedTokenId}`)
setIsLoadingMint(false)
router.push(`/team/${teamPrettyLink}`)
setIsLoadingMint(false)
}, 5000)
}
} catch (err) {
console.error(err)
Expand Down

0 comments on commit 2380100

Please sign in to comment.