Integrate wallet IFrame for payments #42

Merged
nabarun merged 27 commits from iv-integrate-frame into main 2024-11-13 13:32:28 +00:00
Showing only changes of commit b214702a5e - Show all commits

View File

@ -333,6 +333,7 @@ const Configure = () => {
const senderAddress = selectedAccount;
const snowballAddress = await client.getAddress();
let timeoutId;
try {
setIsPaymentDone(false);
@ -365,7 +366,7 @@ const Configure = () => {
window.addEventListener('message', handleTxStatus);
// Set a timeout, consider unsuccessful after 1 min
setTimeout(() => {
timeoutId = setTimeout(() => {
reject(new Error('Transaction timeout'));
window.removeEventListener('message', handleTxStatus);
toast({
@ -382,6 +383,7 @@ const Configure = () => {
throw new Error('Error in transaction');
} finally {
setIsPaymentLoading(false);
clearTimeout(timeoutId);
}
},
[client, dismiss, toast],