Skip to content

Commit

Permalink
feat: use marketplace-server trendings if FF enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Dec 12, 2024
1 parent 9481cb7 commit 8552901
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webapp/src/modules/item/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,17 @@ export function* itemSaga(getIdentity: () => AuthIdentity | undefined) {
// If the wallet is getting connected, wait until it finishes to fetch the items so it can fetch them with authentication

try {
yield call(waitForFeatureFlagsToBeLoaded)
const isMarketplaceServerEnabled: boolean = yield select(getIsMarketplaceServerEnabled)
yield call(waitForWalletConnectionAndIdentityIfConnecting)
const { data }: { data: Item[] } = yield call([itemAPI, 'getTrendings'], size)
const { data }: { data: Item[] } = yield call([isMarketplaceServerEnabled ? marketplaceItemAPI : itemAPI, 'getTrendings'], size)

if (!data.length) {
yield put(fetchTrendingItemsSuccess([]))
return
}

const ids = data.map(item => item.id)
const isMarketplaceServerEnabled: boolean = yield select(getIsMarketplaceServerEnabled)
const api = isMarketplaceServerEnabled ? marketplaceServerCatalogAPI : catalogAPI
const isOffchainEnabled: boolean = yield select(getIsOffchainPublicNFTOrdersEnabled)
const { data: itemData }: { data: Item[]; total: number } = yield call(
Expand Down

0 comments on commit 8552901

Please sign in to comment.