Skip to content

Commit

Permalink
chore: syntax improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho112 committed Mar 29, 2023
1 parent c93b566 commit 4dd2371
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ export const WalletSelectorModal = ({ onComplete, migrationAccounts, network, ro
useEffect(() => {
const init = async () => {
const accountsWithKey = await Promise.all(migrationAccounts.map(async (account) => {
const privateKey = rotatedKeys[account.accountId];
const accountId = account.accountId;
const privateKey = rotatedKeys[accountId];
if (!privateKey) {
throw new Error('Unable to find a private key from the rotated keys');
}

return {
accountId: account.accountId,
privateKey: rotatedKeys[account.accountId],
accountId,
privateKey,
};
}));
setAccounts(accountsWithKey);
Expand Down

0 comments on commit 4dd2371

Please sign in to comment.