diff --git a/src/pages/Onboarding2.jsx b/src/pages/Onboarding2.jsx index 1254836..13200e6 100644 --- a/src/pages/Onboarding2.jsx +++ b/src/pages/Onboarding2.jsx @@ -40,7 +40,12 @@ const Onboarding2 = observer(()=>{ } else { setFillingForm(true) } - registrationStore.saveDataRegistration(dataRegistration) + registrationStore.saveDataRegistration(Object.keys(dataRegistration).map(item=>{ + return{ + key: `${item}`, + value: dataRegistration[item] + } + })) } useEffect(()=>{ diff --git a/src/pages/Onboarding4.jsx b/src/pages/Onboarding4.jsx index 116e0f4..f84f292 100644 --- a/src/pages/Onboarding4.jsx +++ b/src/pages/Onboarding4.jsx @@ -81,7 +81,7 @@ const Onboarding4 = observer(()=>{ -

{registrationStore.accountData.first_name ? `Nice to meet you, ${registrationStore.accountData.first_name} 🙌` : 'Please, go back step 2'}

+

{registrationStore.accountData.find(item=>item.key="first_name").key ? `Nice to meet you, ${registrationStore.accountData.find(item=>item.key="first_name").value} 🙌` : 'Please, go back step 2'}

diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index 16ada22..a1fb4e0 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -8,7 +8,6 @@ import ProfileTable from '../../partials/digitalId/ProfileTable'; import Image from '../../images/transactions-image-04.svg'; const Profile = observer (() => { - console.log(registrationStore.accountData) const [sidebarOpen, setSidebarOpen] = useState(false); const [buttonPanelOpen, setButtonPanelOpen] = useState(true); const [removePanelOpen, setRemovePanelOpen] = useState(false); @@ -76,10 +75,8 @@ const Profile = observer (() => { } const deletePropertyData = () => { - const newDataPush = {} const changeData = userDataStore.decryptedData.filter(item=>!selectedItems.includes(item.key)) - changeData.forEach(pushData=>newDataPush[pushData.key]=pushData.value) - registrationStore.pushAccountData(newDataPush) + registrationStore.pushAccountData(changeData) } const cancelAddPanel = () => { diff --git a/src/store/store.js b/src/store/store.js index b5207ad..92d8de7 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -74,10 +74,10 @@ class Store { }; encryptAccountData(data) { - return Object.keys(data).map((label) => { - let value = cryptography.encryptMessageWithPassphrase(cryptography.getRandomBytes(32).toString('hex') + ":" + this.accountData[label], this.passPhrase, this.pubKey); + return data.map((item) => { + let value = cryptography.encryptMessageWithPassphrase(cryptography.getRandomBytes(32).toString('hex') + ":" + item.value, this.passPhrase, this.pubKey); return { - "label": label, + "label": item.key, "value": value.encryptedMessage, "value_nonce": value.nonce, }