From e09b5a51883632d28aadcd2df2cf3a92c816dc1b Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:59:47 +0500 Subject: [PATCH] fix(swaps): `isItemSelected` computed --- components/items/ItemsGrid/useAtomicSwapAction.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/items/ItemsGrid/useAtomicSwapAction.ts b/components/items/ItemsGrid/useAtomicSwapAction.ts index 79a6ad371d..3354453767 100644 --- a/components/items/ItemsGrid/useAtomicSwapAction.ts +++ b/components/items/ItemsGrid/useAtomicSwapAction.ts @@ -4,14 +4,16 @@ import { SwapStep } from '@/components/swap/types' export default (nft: NFTWithMetadata) => { const route = useRoute() const swapStore = useAtomicSwapStore() - const { step, stepItems } = storeToRefs(swapStore) + const { swap, step, stepItems } = storeToRefs(swapStore) const routeName = computed(() => route.name?.toString() as string) const showAtomicSwapAction = computed(() => ATOMIC_SWAP_PAGES.includes(routeName.value)) const isItemSelected = computed(() => { - return step.value === SwapStep.REVIEW ? false : stepItems.value?.some(item => item.id === nft.id) + return step.value === SwapStep.REVIEW + ? false + : [...swap.value.desired, ...swap.value.offered].flat().some(item => item.id === nft.id) }) const onAtomicSwapSelect = () => {