From 5635fd2a7e111564b88a7e711bb5c02780289529 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Tue, 12 Nov 2024 11:52:02 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=A7=20action=20list=20price=20is?= =?UTF-8?q?=5Fnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/items/ItemsGrid/useNftActions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/items/ItemsGrid/useNftActions.ts b/components/items/ItemsGrid/useNftActions.ts index f0338eeffa..fe838553bf 100644 --- a/components/items/ItemsGrid/useNftActions.ts +++ b/components/items/ItemsGrid/useNftActions.ts @@ -40,6 +40,9 @@ export const prepareListingQuery = ( token: tokenSearchTerm, currentOwner_eq: accountId.value, burned_eq: false, + OR: { + price_isNull: true, + }, }, ], } From 82b2713fffeb671e7cf844ad3a0ea73515dd155d Mon Sep 17 00:00:00 2001 From: roiLeo Date: Tue, 19 Nov 2024 13:17:33 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A7=20action=20list=20on=20owned?= =?UTF-8?q?=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/items/ItemsGrid/ItemsGridImageTokenEntity.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue index 922c92a68b..848cf7fd3c 100644 --- a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue +++ b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue @@ -200,9 +200,8 @@ const onClickShoppingCart = async () => { const onClickListingCart = async () => { const nftsToProcess = await getTokensNfts([props.entity]) - for (const nft of nftsToProcess) { - listNftByNftWithMetadata(nft, { toggle: true }) - } + // force array0 instead for (const nft of nftsToProcess) {} + listNftByNftWithMetadata(nftsToProcess[0], { toggle: true }) } onMounted(async () => { From 671180afbfe1bac8be839554377358a78d8a36c0 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Thu, 21 Nov 2024 08:47:36 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A7=20variables=20prepareListingQu?= =?UTF-8?q?ery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/items/ItemsGrid/ItemsGridImageTokenEntity.vue | 6 ++++-- components/items/ItemsGrid/useNftActions.ts | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue index 848cf7fd3c..25eed85816 100644 --- a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue +++ b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue @@ -200,8 +200,10 @@ const onClickShoppingCart = async () => { const onClickListingCart = async () => { const nftsToProcess = await getTokensNfts([props.entity]) - // force array0 instead for (const nft of nftsToProcess) {} - listNftByNftWithMetadata(nftsToProcess[0], { toggle: true }) + console.log(nftsToProcess) + for (const nft of nftsToProcess) { + listNftByNftWithMetadata(nft, { toggle: true }) + } } onMounted(async () => { diff --git a/components/items/ItemsGrid/useNftActions.ts b/components/items/ItemsGrid/useNftActions.ts index fe838553bf..7e6d795a4d 100644 --- a/components/items/ItemsGrid/useNftActions.ts +++ b/components/items/ItemsGrid/useNftActions.ts @@ -42,6 +42,9 @@ export const prepareListingQuery = ( burned_eq: false, OR: { price_isNull: true, + token: tokenSearchTerm, + currentOwner_eq: accountId.value, + burned_eq: false, }, }, ], From a743b7b37e40b897e8734189ebb8fcd63a93de22 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Thu, 21 Nov 2024 08:49:34 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9E=96=20console=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/items/ItemsGrid/ItemsGridImageTokenEntity.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue index 25eed85816..922c92a68b 100644 --- a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue +++ b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue @@ -200,7 +200,6 @@ const onClickShoppingCart = async () => { const onClickListingCart = async () => { const nftsToProcess = await getTokensNfts([props.entity]) - console.log(nftsToProcess) for (const nft of nftsToProcess) { listNftByNftWithMetadata(nft, { toggle: true }) } From f1bf71f27859fe342d16ef6d82806e1c708dc3fc Mon Sep 17 00:00:00 2001 From: roiLeo Date: Fri, 22 Nov 2024 15:55:05 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A7=20action=20list=20remove=20pri?= =?UTF-8?q?ce=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/items/ItemsGrid/useNftActions.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/components/items/ItemsGrid/useNftActions.ts b/components/items/ItemsGrid/useNftActions.ts index 7e6d795a4d..b665480167 100644 --- a/components/items/ItemsGrid/useNftActions.ts +++ b/components/items/ItemsGrid/useNftActions.ts @@ -27,32 +27,19 @@ export const fetchNft = async (nftId: string): Promise => { export const prepareListingQuery = ( entities: TokenEntity[], - isThereAnythingToList: boolean, ) => { const { accountId } = useAuth() - - const tokenSearchTerm = { id_in: entities.map(n => n.id) } - const variables = { first: 10000, // some large number search: [ { - token: tokenSearchTerm, + token: { id_in: entities.map(n => n.id) }, currentOwner_eq: accountId.value, burned_eq: false, - OR: { - price_isNull: true, - token: tokenSearchTerm, - currentOwner_eq: accountId.value, - burned_eq: false, - }, }, ], } - const searchKey = isThereAnythingToList ? 'price_eq' : 'price_gt' - variables.search[0][searchKey] = '0' - return { query: nftListWithSearch, variables, @@ -80,10 +67,7 @@ const getCachedAndMissingEntities = ( const fetchMissingEntities = async ( missingEntities: TokenEntity[], ): Promise => { - const { query, variables } = prepareListingQuery( - missingEntities, - await checkIfAnythingToList(missingEntities), - ) + const { query, variables } = prepareListingQuery(missingEntities) const { client } = usePrefix() const { data } = await useAsyncQuery<{ nFTEntities: NFTWitToken[] }>({