Skip to content

Commit

Permalink
Remove redundant conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
reyraa committed Sep 8, 2021
1 parent df151c5 commit 21a718d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/store/actions/account.js
Expand Up @@ -60,22 +60,17 @@ const getAccounts = async ({ network, params }) =>
*/
export const accountDataUpdated = tokensTypes =>
async (dispatch, getState) => {
const state = getState();
const { network, settings, account } = state;
const { network, settings, account } = getState();

// Get the list of tokens that are enabled in settings
const activeTokens = tokensTypes === 'enabled'
? Object.keys(settings.token.list)
.filter(key => settings.token.list[key])
: [settings.token.active];

// Collect their addresses to send to the API
const params = activeTokens.reduce((acc, token) => {
if (token === tokenMap.LSK.key) {
acc[token] = { address: account.info[tokenMap.LSK.key].summary.address };
} else {
acc[token] = {
address: account.info[token].summary.address,
passphrase: account.passphrase,
};
}
acc[token] = { address: account.info[token].summary.address };
return acc;
}, {});

Expand Down

0 comments on commit 21a718d

Please sign in to comment.