Make admin crypto address tickers more forgiving

merge-requests/576/head
Alex Gleason 2021-07-02 18:49:32 -05:00
rodzic a58fc810fb
commit 02c725adbe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -5,11 +5,20 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import CryptoAddress from './crypto_address';
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 = () => {
return createSelector(
[(addresses, limit) => typeof limit === 'number' ? addresses.take(limit) : addresses],
addresses => addresses,
addresses => normalizeAddresses(addresses),
);
};