fix verify link not updated

This commit is contained in:
Mentor Palokaj 2021-11-08 09:39:09 +01:00
parent e9b665f15d
commit 98238ac5a3

View File

@ -64,6 +64,20 @@ export default function Verifier() {
}, [ verificationCode ] ) }, [ verificationCode ] )
// Update verificaiton url
useEffect( f => {
if( !username || !address || !balance ) return
if( !verifyUrl ) return
if( balance < 1 ) return
const baseUrl = `https://mint.rocketeer.fans/#/verify/`
const message = btoa( `{ "username": "${ username }", "address": "${ address }", "balance": "${ balance }" }` )
setVerifyUrl( baseUrl + message )
}, [ username, address, balance, verifyUrl ] )
// /////////////////////////////// // ///////////////////////////////
// Rendering // Rendering
// /////////////////////////////// // ///////////////////////////////
@ -76,9 +90,13 @@ export default function Verifier() {
if( verifyUrl ) return <Container> if( verifyUrl ) return <Container>
{ !balance && <p>Checking your on-chain balance...</p> }
{ balance && <>
<h1>Verification URL</h1> <h1>Verification URL</h1>
<p>Post this in the Discord channel #get-verified:</p> <p>Post this in the Discord channel #get-verified:</p>
<p>{ verifyUrl }</p> <p>{ verifyUrl }</p>
</> }
</Container> </Container>