Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit ff37bc8

Browse files
committed
fix: disable claim button after click
1 parent 3bb4e3f commit ff37bc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/html/landing.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,18 @@ <h1 class="modal__heading">Claim your NEAR account</h1>
168168
}
169169
window.dom.show("claimModal")
170170
})
171-
window.dom.onClick('claimNearAccount', async function renderClaimModal () {
171+
172+
const claimButton = window.dom.find("claimNearAccount");
173+
claimButton.onclick = async () => {
172174
window.dom.fill('claimMessage').with('To claim, please sign the message when prompted on your Ethereum wallet...');
173175
try{
176+
claimButton.disabled = true
174177
await window.faucetUtils.claim()
175178
} catch(error) {
176179
window.dom.fill('claimMessage').with(error.message)
180+
claimButton.disabled = false
177181
}
178-
})
182+
}
179183
})
180184

181185
async function renderLanding() {

0 commit comments

Comments
 (0)