Skip to content

Commit

Permalink
reset timer if sign message fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp committed Jun 28, 2023
1 parent a64b540 commit 1499d06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hooks/useForumConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ export default function useForumConnect() {
setIsValidated(undefined)
const signedMessage = await signer.signMessage(message)
if (!signedMessage) {
resetTimer()
throw new Error('Failed to sign message')
}

setClipboardMessage(`${message}\nSignature: ${signedMessage}`)
return signedMessage
}, [startTimer, userState.provider])
}, [startTimer, resetTimer, userState.provider])

const copyMessageToClipboard = useCallback(() => {
if (clipboardMessage) {
Expand Down

0 comments on commit 1499d06

Please sign in to comment.