From 3de1250074be53fc2ab48fe178331d9a4092fedc Mon Sep 17 00:00:00 2001 From: Gabriel Diaz Date: Thu, 27 Jul 2023 11:48:28 -0300 Subject: [PATCH] fix: Missing brace after rebase --- webapp/src/modules/nft/sagas.ts | 81 +++++++++++++++++---------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/webapp/src/modules/nft/sagas.ts b/webapp/src/modules/nft/sagas.ts index 46be96cf44..75aa71b060 100644 --- a/webapp/src/modules/nft/sagas.ts +++ b/webapp/src/modules/nft/sagas.ts @@ -167,49 +167,50 @@ export function* nftSaga(getIdentity: () => AuthIdentity | undefined) { } } -function* handleTransferNFTRequest(action: TransferNFTRequestAction) { - const { nft, address } = action.payload - try { - const vendor: Vendor = yield call( - VendorFactory.build, - nft.vendor - ) - - const wallet: ReturnType = yield select(getWallet) - if (!wallet) { - throw new Error('A wallet is needed to perform a NFT transfer request') - } + function* handleTransferNFTRequest(action: TransferNFTRequestAction) { + const { nft, address } = action.payload + try { + const vendor: Vendor = yield call( + VendorFactory.build, + nft.vendor + ) + + const wallet: ReturnType = yield select(getWallet) + if (!wallet) { + throw new Error('A wallet is needed to perform a NFT transfer request') + } - const txHash: string = yield call( - [vendor.nftService, 'transfer'], - wallet, - address, - nft - ) - yield put(transferNFTransactionSubmitted(nft, address, txHash)) - if (nft?.openRentalId) { - yield call(waitForTx, txHash) - const rental: RentalListing | null = yield select( - getRentalById, - nft.openRentalId + const txHash: string = yield call( + [vendor.nftService, 'transfer'], + wallet, + address, + nft ) - if (isRentalListingOpen(rental)) { - yield call(waitUntilRentalChangesStatus, nft, RentalStatus.CANCELLED) + yield put(transferNFTransactionSubmitted(nft, address, txHash)) + if (nft?.openRentalId) { + yield call(waitForTx, txHash) + const rental: RentalListing | null = yield select( + getRentalById, + nft.openRentalId + ) + if (isRentalListingOpen(rental)) { + yield call(waitUntilRentalChangesStatus, nft, RentalStatus.CANCELLED) + } } - } - yield put(transferNFTSuccess(nft, address)) - } catch (error) { - const errorMessage = isErrorWithMessage(error) - ? error.message - : t('global.unknown_error') - const errorCode = - error !== undefined && - error !== null && - typeof error === 'object' && - 'code' in error - ? (error as { code: ErrorCode }).code - : undefined - yield put(transferNFTFailure(nft, address, errorMessage, errorCode)) + yield put(transferNFTSuccess(nft, address)) + } catch (error) { + const errorMessage = isErrorWithMessage(error) + ? error.message + : t('global.unknown_error') + const errorCode = + error !== undefined && + error !== null && + typeof error === 'object' && + 'code' in error + ? (error as { code: ErrorCode }).code + : undefined + yield put(transferNFTFailure(nft, address, errorMessage, errorCode)) + } } }