Skip to content

Commit

Permalink
feat(nfts): cleanup nft sagas file
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed May 3, 2022
1 parent dba9445 commit f8b77f6
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NftFilterFormValuesType } from 'blockchain-wallet-v4-frontend/src/scenes/Nfts/NftFilter'
import { addDays, addMinutes, getUnixTime } from 'date-fns'
import { ethers, Signer } from 'ethers'
import { all, call, put, select, take } from 'redux-saga/effects'
import { all, call, put, select } from 'redux-saga/effects'

import { Exchange, Remote } from '@core'
import { APIType } from '@core/network/api'
Expand All @@ -27,7 +27,6 @@ import { Await } from '@core/types'
import { errorHandler } from '@core/utils'
import { getPrivateKey } from '@core/utils/eth'
import { actions, selectors } from 'data'
import { actionTypes } from 'data/form/actionTypes'
import { ModalName } from 'data/modals/types'
import { Analytics } from 'data/types'
import { promptForSecondPassword } from 'services/sagas'
Expand Down Expand Up @@ -622,18 +621,11 @@ export default ({ api }: { api: APIType }) => {
}
}

// MODIFY URL
// GET CURRENT URL
const url = new URL(window.location.href)
const [hash, query] = url.href.split('#')[1].split('?')
// @ts-ignore
const params = Object.fromEntries(new URLSearchParams(query))
// FOR SALE
if (action.meta.field === 'forSale') {
params.forSale = action.payload
}
if (action.meta.field === 'event') {
params.event = action.payload
}
// NON-TRAITS
if (nonTraitFilters.includes(action.meta.field)) {
params[action.meta.field] = action.payload
Expand All @@ -649,6 +641,7 @@ export default ({ api }: { api: APIType }) => {
}
}

// MODIFY URL
const newHash = `${hash}?${Object.entries(params)
.map(([key, value]) => `${key}=${value}`)
.join('&')}`
Expand Down

0 comments on commit f8b77f6

Please sign in to comment.