Skip to content

Commit bd37dd4

Browse files
authored
Merge branch 'main' into issue-10663
2 parents bc2cfd7 + 862805e commit bd37dd4

File tree

14 files changed

+90
-37
lines changed

14 files changed

+90
-37
lines changed

components/buy/Buy.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const { $i18n } = useNuxtApp()
5454
const { isTransactionSuccessful } = useTransactionSuccessful({
5555
status,
5656
isError,
57+
isLoading,
5758
})
5859
5960
const nftSubscription = reactive<{

components/collection/drop/HolderOfGenerative.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
v-if="isHolderOfWithPaidMint"
3434
v-model="isMintModalActive"
3535
:action="autoTeleportAction"
36-
:status="status"
37-
:is-error="isTransactionError"
3836
@confirm="mintNft"
3937
@close="closeMintModal"
4038
@list="handleList"

components/collection/drop/PaidGenerative.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<CollectionDropModalPaidMint
55
v-model="isMintModalActive"
66
:action="autoTeleportAction"
7-
:status="status"
8-
:is-error="isError"
97
@confirm="mintNft"
108
@close="handleMintModalClose"
119
@list="handleList"

components/collection/drop/modal/PaidMint.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ const emit = defineEmits(['confirm', 'update:modelValue', 'list', 'close'])
6565
const props = defineProps<{
6666
modelValue: boolean
6767
action: AutoTeleportAction
68-
status: TransactionStatus
69-
isError: boolean
7068
}>()
7169
7270
const { canMint, canList } = useDropMassMintState()
@@ -86,6 +84,16 @@ const modalStep = ref<ModalStep>(ModalStep.OVERVIEW)
8684
const autoteleportCompleted = ref(false)
8785
const isModalOpen = useVModel(props, 'modelValue')
8886
87+
const isError = computed(() => props.action.details.isError)
88+
const status = computed(() => props.action.details.status)
89+
const isLoading = computed(() => props.action.details.isLoading)
90+
91+
const { isTransactionSuccessful } = useTransactionSuccessful({
92+
status,
93+
isError,
94+
isLoading,
95+
})
96+
8997
const isSingleMintNotReady = computed(
9098
() => amountToMint.value === 1 && !canMint.value,
9199
)
@@ -121,7 +129,8 @@ const moveSuccessfulDrop = computed<boolean>(
121129
() =>
122130
imagePreloadingCompleted.value
123131
&& Boolean(mintingSession.value.items.length)
124-
&& Boolean(mintingSession.value.txHash),
132+
&& Boolean(mintingSession.value.txHash)
133+
&& isTransactionSuccessful.value,
125134
)
126135
127136
const transactionStatus = computed(() => {

components/common/autoTeleport/AutoTeleportModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ watch(
282282
const { isTransactionSuccessful } = useTransactionSuccessful({
283283
isError: action.isError,
284284
status: action.status,
285+
isLoading: action.isLoading,
285286
})
286287
287288
watch(

components/common/listingCart/ListingCartModal.vue

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ import useAutoTeleportActionButton from '@/composables/autoTeleport/useAutoTelep
119119
const { urlPrefix } = usePrefix()
120120
const preferencesStore = usePreferencesStore()
121121
const listingCartStore = useListingCartStore()
122+
const { closeListingCartModal } = useListingCartModal()
122123
const { $i18n } = useNuxtApp()
123124
const {
124125
transaction,
@@ -133,6 +134,7 @@ const {
133134
const { isTransactionSuccessful } = useTransactionSuccessful({
134135
status,
135136
isError,
137+
isLoading,
136138
})
137139
138140
const { chainSymbol, decimals } = useChain()
@@ -143,9 +145,7 @@ const floorPricePercentAdjustment = ref()
143145
const itemCount = ref(listingCartStore.count)
144146
const items = ref<ListCartItem[]>([])
145147
146-
const isSuccessModalOpen = computed(
147-
() => Boolean(items.value.length) && isTransactionSuccessful.value,
148-
)
148+
const isSuccessModalOpen = ref(false)
149149
150150
const teleportTransitionTxFees = computed(() =>
151151
format(
@@ -283,29 +283,41 @@ async function confirm({ autoteleport }: AutoTeleportActionButtonConfirmEvent) {
283283
await submitListing()
284284
}
285285
286-
listingCartStore.clearListedItems()
287286
closeListingCartModal()
288-
resetCartToDefaults()
287+
onModalAnimation(() => {
288+
listingCartStore.clearListedItems()
289+
resetCartToDefaults()
290+
})
289291
}
290292
catch (error) {
291293
warningMessage(error)
292294
}
293295
}
294296
295297
const onClose = () => {
296-
resetCartToDefaults()
297298
closeListingCartModal()
299+
onModalAnimation(resetCartToDefaults)
298300
}
299301
300302
const handleSuccessModalClose = () => {
301-
items.value = []
303+
isSuccessModalOpen.value = false
304+
onModalAnimation(() => {
305+
items.value = []
306+
isTransactionSuccessful.value = false
307+
})
302308
}
303309
304310
const resetCartToDefaults = () => {
305311
fixedPrice.value = undefined
306312
floorPricePercentAdjustment.value = undefined
307313
}
308314
315+
watch(computed(() => Boolean(items.value.length) && isTransactionSuccessful.value), (show) => {
316+
if (show) {
317+
isSuccessModalOpen.value = show
318+
}
319+
})
320+
309321
watch(
310322
() => listingCartStore.count,
311323
() => {
@@ -315,17 +327,10 @@ watch(
315327
},
316328
)
317329
318-
watch(
319-
() => preferencesStore.listingCartModalOpen,
320-
(listingCartModalOpen) => {
321-
if (!listingCartModalOpen) {
322-
listingCartStore.clearDiscardedItems()
323-
}
324-
},
325-
)
326-
327-
const closeListingCartModal = () =>
328-
(preferencesStore.listingCartModalOpen = false)
330+
useModalIsOpenTracker({
331+
isOpen: computed(() => preferencesStore.listingCartModalOpen),
332+
onChange: () => listingCartStore.clearDiscardedItems(),
333+
})
329334
330335
onBeforeMount(closeListingCartModal)
331336
onUnmounted(closeListingCartModal)

components/create/CreateCollection.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ const displaySuccessModal = ref(false)
248248
const { transaction, status, isLoading, isError, blockNumber, txHash }
249249
= useTransaction()
250250
const { isTransactionSuccessful } = useTransactionSuccessful({
251-
isError: isError,
252-
status: status,
251+
status,
252+
isError,
253+
isLoading,
253254
})
254255
const { urlPrefix, setUrlPrefix } = usePrefix()
255256
const { $consola, $i18n } = useNuxtApp()

components/offer/MakeOffer.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
<MakingOfferSingleItem v-if="offerStore.items.length === 1" />
2929
</div>
3030

31+
<div class="border-t pt-5 pb-4 px-6">
32+
<div
33+
class="flex justify-between text-k-grey border-b-k-shade"
34+
>
35+
<span>{{ $t('offer.offerFees') }}</span>
36+
<span class="ml-2">{{ teleportTransitionTxFees }}</span>
37+
</div>
38+
</div>
39+
3140
<div class="flex justify-between px-6">
3241
<AutoTeleportActionButton
3342
ref="autoTeleportButton"
@@ -55,7 +64,7 @@ import ModalBody from '@/components/shared/modals/ModalBody.vue'
5564
import { usePreferencesStore } from '@/stores/preferences'
5665
import type { Actions, TokenToOffer } from '@/composables/transaction/types'
5766
import { useMakingOfferStore } from '@/stores/makeOffer'
58-
import { calculateBalance } from '@/utils/format/balance'
67+
import format, { calculateBalance } from '@/utils/format/balance'
5968
import { warningMessage } from '@/utils/notification'
6069
import ModalIdentityItem from '@/components/shared/ModalIdentityItem.vue'
6170
import AutoTeleportActionButton, {
@@ -87,7 +96,7 @@ const {
8796
const { notification, lastSessionId, updateSession } = useLoadingNotfication()
8897
const { itemsInChain, hasInvalidOfferPrices, count } = storeToRefs(offerStore)
8998
90-
const { decimals } = useChain()
99+
const { decimals, chainSymbol } = useChain()
91100
const { $i18n } = useNuxtApp()
92101
const items = ref<MakingOfferItem[]>([])
93102
@@ -104,6 +113,14 @@ const getAction = (items: MakingOfferItem[]): Actions => {
104113
}
105114
}
106115
116+
const teleportTransitionTxFees = computed(() =>
117+
format(
118+
(autoTeleportButton.value?.optimalTransition.txFees || 0) + OFFER_MINT_PRICE,
119+
decimals.value,
120+
chainSymbol.value,
121+
),
122+
)
123+
107124
const { action, autoTeleport, autoTeleportButton, autoTeleportLoaded } = useAutoTeleportActionButton({
108125
getActionFn: () => getAction(itemsInChain.value),
109126
})

components/shared/SigningModal/SigningModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const { $i18n } = useNuxtApp()
4646
const { isTransactionSuccessful } = useTransactionSuccessful({
4747
isError: computed(() => props.isError),
4848
status: computed(() => props.status),
49+
isLoading: computed(() => props.isLoading),
4950
})
5051
5152
const isModalActive = ref(false)

composables/useListingCartModal.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export default ({
5050
const openListingCartModal = () =>
5151
(preferencesStore.listingCartModalOpen = true)
5252

53+
const closeListingCartModal = () =>
54+
(preferencesStore.listingCartModalOpen = false)
55+
5356
const clearItemsInChain = () => {
5457
listingCartStore.itemsInChain.forEach(item =>
5558
listingCartStore.removeItem(item.id),
@@ -76,5 +79,6 @@ export default ({
7679
listNftByShoppingCartItem,
7780
listNftByNftWithMetadata,
7881
openListingCartModal,
82+
closeListingCartModal,
7983
}
8084
}

0 commit comments

Comments
 (0)