Skip to content

Commit

Permalink
reuse codes second time you click
Browse files Browse the repository at this point in the history
  • Loading branch information
nearnshaw committed Jun 19, 2020
1 parent c1c9016 commit 34dc9fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion POAP-booth/bin/game.js

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions POAP-booth/src/poapHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type signedEventData = {
event_id: string
}

let qrHex: string

let secret: eventData

let signature: signedEventData

export async function fetchUserData() {
const data = await getUserData()
log(data.displayName)
Expand Down Expand Up @@ -97,11 +103,17 @@ export async function makeTransaction(event: string) {
log('no wallet')
return
}
let qrHex: string = await callQRAPI(event)
if (!qrHex) {
qrHex = await callQRAPI(event)
}

let secret: eventData = await getSecret(qrHex)
if (!secret) {
secret = await getSecret(qrHex)
}

let signature: signedEventData = await getSignedMessage(secret, qrHex)
if (!signature) {
signature = await getSignedMessage(secret, qrHex)
}

log('signature for request ', signature)

Expand Down

0 comments on commit 34dc9fa

Please sign in to comment.