Skip to content

Commit

Permalink
Filter and sort multi token display
Browse files Browse the repository at this point in the history
  • Loading branch information
mikozet committed Sep 21, 2023
1 parent b01c58b commit bf1cb67
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/store/token/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import notify, { NotificationsTypes } from '~/store/notifications/actions';
import ActionTypes from '~/store/token/types';
import { PATHFINDER_HOPS_DEFAULT, ZERO_ADDRESS } from '~/utils/constants';
import logError, { translateErrorForUser } from '~/utils/debug';
import { formatCirclesValue } from '~/utils/format';
import { isTokenDeployed, waitAndRetryOnFail } from '~/utils/stateChecks';

const { ActivityTypes } = core.activity;
Expand Down Expand Up @@ -175,10 +176,14 @@ export function checkOtherTokens() {

try {
const otherTokens = await core.token.listAllTokens(safe.currentAccount);

const filterOrderedOtherTokens = otherTokens
.filter((item) => item.amount > tcToCrc(Date.now(), Number(0.005)))
.reverse();
dispatch({
type: ActionTypes.TOKEN_UPDATE_OTHER_TOKENS,
meta: {
otherTokens,
otherTokens: filterOrderedOtherTokens,
},
});
dispatch({
Expand Down

0 comments on commit bf1cb67

Please sign in to comment.