• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / marketplace / 8112105893

01 Mar 2024 01:26PM UTC coverage: 66.172% (-0.1%) from 66.297%
8112105893

Pull #2161

github

LautaroPetaccio
Merge branch 'master' of github.com:decentraland/marketplace into feat/improve-marketplace-loading-time
Pull Request #2161: feat: Reduce Marketplace size by async loading Squid

2481 of 4871 branches covered (50.93%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 3 files covered. (71.43%)

15 existing lines in 8 files now uncovered.

7550 of 10288 relevant lines covered (73.39%)

71.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.18
/webapp/src/modules/tile/sagas.ts
1
import { takeEvery, call, put } from 'redux-saga/effects'
28✔
2
import { RentalStatus } from '@dcl/schemas'
28✔
3
import { AxiosResponse } from 'axios'
4
import { atlasAPI } from '../../modules/vendor/decentraland'
28✔
5
import {
6
  FETCH_TILES_REQUEST,
7
  FetchTilesRequestAction,
8
  fetchTilesSuccess,
9
  fetchTilesFailure
10
} from './actions'
28✔
11
import {
12
  ConnectWalletSuccessAction,
13
  CONNECT_WALLET_SUCCESS
14
} from 'decentraland-dapps/dist/modules/wallet/actions'
28✔
15
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
28✔
16
import { isErrorWithMessage } from '../../lib/error'
28✔
17
import { fetchNFTsRequest } from '../nft/actions'
28✔
18
import { VendorName } from '../vendor'
28✔
19
import { View } from '../ui/types'
28✔
20
import { AtlasTile } from 'decentraland-ui'
21

22
export function* tileSaga() {
237✔
23
  yield takeEvery(FETCH_TILES_REQUEST, handleFetchTilesRequest)
237✔
24
  yield takeEvery(CONNECT_WALLET_SUCCESS, handleConnectWalletSuccess)
237✔
25
}
26

27
function* handleFetchTilesRequest(_action: FetchTilesRequestAction) {
28
  try {
237✔
29
    const response: AxiosResponse<{
30
      data: Record<string, AtlasTile>
31
    }> = yield call(atlasAPI.fetchTiles)
237✔
UNCOV
32
    const tiles = response.data.data
×
UNCOV
33
    const lastModified = response.headers['last-modified']
×
UNCOV
34
    yield put(fetchTilesSuccess(tiles, new Date(lastModified)))
×
35
  } catch (error) {
36
    yield put(
×
37
      fetchTilesFailure(
38
        isErrorWithMessage(error) ? error.message : t('global.unknown_error')
×
39
      )
40
    )
41
  }
42
}
43

44
function* handleConnectWalletSuccess(action: ConnectWalletSuccessAction) {
45
  yield put(
×
46
    fetchNFTsRequest({
47
      vendor: VendorName.DECENTRALAND,
48
      view: View.ATLAS,
49
      params: {
50
        first: 1000,
51
        skip: 0,
52
        address: action.payload.wallet.address.toLowerCase()
53
      },
54
      filters: {
55
        isLand: true,
56
        rentalStatus: [
57
          RentalStatus.OPEN,
58
          RentalStatus.CANCELLED,
59
          RentalStatus.EXECUTED
60
        ]
61
      }
62
    })
63
  )
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc