Merge branch 'crypto-ticker-forgiving' into 'develop'
Make admin crypto address tickers more forgiving See merge request soapbox-pub/soapbox-fe!576
This commit is contained in:
commit
a184ee5feb
|
@ -5,11 +5,20 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import CryptoAddress from './crypto_address';
|
import CryptoAddress from './crypto_address';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
import { trimStart } from 'lodash';
|
||||||
|
|
||||||
|
const normalizeAddress = address => {
|
||||||
|
return address.update('ticker', '', ticker => {
|
||||||
|
return trimStart(ticker, '$').toLowerCase();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const normalizeAddresses = addresses => addresses.map(normalizeAddress);
|
||||||
|
|
||||||
const makeGetCoinList = () => {
|
const makeGetCoinList = () => {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
[(addresses, limit) => typeof limit === 'number' ? addresses.take(limit) : addresses],
|
[(addresses, limit) => typeof limit === 'number' ? addresses.take(limit) : addresses],
|
||||||
addresses => addresses,
|
addresses => normalizeAddresses(addresses),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue