Merge pull request #31 from franze6/DID-6
Changing data in store to array
This commit is contained in:
@@ -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(()=>{
|
||||
|
||||
@@ -81,7 +81,7 @@ const Onboarding4 = observer(()=>{
|
||||
<circle className="text-emerald-100" cx="32" cy="32" r="32" />
|
||||
<path className="text-emerald-500" d="m28.5 41-8-8 3-3 5 5 12-12 3 3z" />
|
||||
</svg>
|
||||
<h1 className="text-3xl text-slate-800 font-bold mb-8">{registrationStore.accountData.first_name ? `Nice to meet you, ${registrationStore.accountData.first_name} 🙌` : 'Please, go back step 2'}</h1>
|
||||
<h1 className="text-3xl text-slate-800 font-bold mb-8">{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'}</h1>
|
||||
<button onClick={()=>createAccount()} className="btn px-6 bg-indigo-500 hover:bg-indigo-600 text-white">
|
||||
<Link id="link-dashboard" to={checkBoxesSelected && "/dashboard"}>Go To Profile -></Link>
|
||||
</button>
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user