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

Commit

Permalink
feat: add nearTxModal to BridgeIt
Browse files Browse the repository at this point in the history
  • Loading branch information
paouvrard committed May 6, 2021
1 parent 4d9b102 commit 2387d1a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/html/bridge-erc20-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,22 @@ <h1 style="background: url(img/unbridged.svg) top center no-repeat; font-size: 1

<script>
window.addEventListener('load', function handleSelectErc20Events () {
window.dom.find('bridgeErc20Form').onsubmit = function bridgeIt (e) {
window.dom.find('bridgeErc20Form').onsubmit = async function bridgeIt (e) {
e.preventDefault()
window.nep141Xerc20.bridgedNep141.deploy(window.urlParams.get('erc20'))
window.dom.show("nearTxModal")
// give the user some time to read the redirect information
await new Promise(r => setTimeout(r, 3000))
try {
await window.nep141Xerc20.bridgedNep141.deploy(window.urlParams.get('erc20'))
} catch (e) {
// only hide if error, show until redirect happens
window.dom.hide("nearTxModal")
alert(
"Something went wrong! " +
"Check your browser console for more info."
);
throw e
}
}

window.dom.find('bridgeErc20Cancel').onclick = () => {
Expand Down

0 comments on commit 2387d1a

Please # to comment.