Skip to content

Commit

Permalink
Merge pull request #6855 from stephenjason89/fix/permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwao authored Aug 25, 2023
2 parents 777e640 + 59e2ae0 commit f616c81
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions components/items/ItemsGrid/useItemsGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function useFetchSearch({
const route = useRoute()

const nfts = ref<NFTWithMetadata[]>([])
const loadedPages = ref([] as number[])

const { searchParams } = useSearchParams()

Expand Down Expand Up @@ -82,10 +83,13 @@ export function useFetchSearch({

total.value = nftEntitiesConnection.totalCount

if (loadDirection === 'up') {
nfts.value = nFTEntities.concat(nfts.value)
} else {
nfts.value = nfts.value.concat(nFTEntities)
if (!loadedPages.value.includes(page)) {
if (loadDirection === 'up') {
nfts.value = nFTEntities.concat(nfts.value)
} else {
nfts.value = nfts.value.concat(nFTEntities)
}
loadedPages.value.push(page)
}

isFetchingData.value = false
Expand All @@ -109,6 +113,7 @@ export function useFetchSearch({
() => route.query.collections,
],
() => {
loadedPages.value = []
resetSearch()
}
)
Expand Down

0 comments on commit f616c81

Please sign in to comment.