Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve switch chain UX, add L2 networks & Zerion, refactor code #82

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use tx.once vs tx.on
theshadowagent committed Oct 13, 2022
commit 3040604975283cacda0f68f6c1e0796ba9ebec44
7 changes: 4 additions & 3 deletions src/components/QuantityModalStep.js
Original file line number Diff line number Diff line change
@@ -54,18 +54,19 @@ export const QuantityModalStep = ({ setQuantity, setIsLoading, setTxHash, state,
if (tx === undefined) {
setIsLoading(false)
}
tx?.on("transactionHash", (hash) => {
tx?.once("transactionHash", (hash) => {
setTxHash(hash)
})?.on("confirmation", async () => {
})?.once("confirmation", async () => {
setIsLoading(false)
setTxHash(undefined)
showAlert(`Successfully minted ${quantityValue} NFTs${window.DEFAULTS?.redirectURL ? ". You will be redirected in less than a second" : ""}`, "success")
// TODO: show success state in the modal
if (window.DEFAULTS?.redirectURL) {
setTimeout(() => {
window.location.href = window.DEFAULTS?.redirectURL
}, 800)
}
})?.on("error", (e) => {
})?.once("error", (e) => {
setIsLoading(false)
const { code, message } = parseTxError(e);
if (code !== 4001) {