From 596c44aac34a9a2ea6fefaadd97b0b875290c612 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Thu, 7 Jul 2022 10:19:31 +0300 Subject: [PATCH] changed strange IIFE function --- src/pages/digitalId/ProfileId.jsx | 36 ++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index e73f2a3..85b59d1 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -114,25 +114,27 @@ const Profile = observer (() => { registrationStore.pushAccountData(changeData); } - const changeDataParameters = () => { - const updatedData = (function changeValue() { - let newArr = [] - userDataStore.decryptedData.map(elem => { - updatedValues.forEach(item => { - if (elem.label === item.label) { - newArr.push({ - ...elem, - 'value': item.value, - 'seed': item.seed, - }) - } - }) - if (!newArr.find(element => element.label === elem.label)) { - newArr.push(elem); + const changeInitialArray = () => { + let newArr = []; + userDataStore.decryptedData.map(elem => { + updatedValues.forEach(item => { + if (elem.label === item.label) { + newArr.push({ + ...elem, + 'value': item.value, + 'seed': item.seed, + }) } }) - return newArr - })(); + if (!newArr.find(element => element.label === elem.label)) { + newArr.push(elem); + } + }) + return newArr; + } + + const changeDataParameters = () => { + const updatedData = changeInitialArray(); registrationStore.pushAccountData(updatedData); }