added data check for the table on Profile page

This commit is contained in:
Daria Golova
2022-08-02 20:57:10 +03:00
parent b4bccf2cba
commit 0e5d7477fc
2 changed files with 9 additions and 5 deletions

View File

@@ -234,7 +234,9 @@ const Profile = observer (() => {
</ul>
</div>
{/* Table */}
<ProfileTable isCheck={isCheck} handleClick={handleClick} userData={registrationStore.decryptedUserData}/>
<div className='w-[828px]'>
<ProfileTable isCheck={isCheck} handleClick={handleClick} userData={registrationStore.decryptedUserData}/>
</div>
</div>
{/* Left sidebar */}
<div>

View File

@@ -121,8 +121,10 @@ class Store {
}
userDataFetchChange(res) {
this._userData = res.data;
}
if (res.data) {
this._userData = res.data;
}
};
keysArrayFetchChange(res) {
this._keysArray = res.data;
@@ -167,12 +169,12 @@ class Store {
})
}
get decryptedUserData(){
get decryptedUserData() {
return this._userData.map((elem) => ({
...elem,
key: elem.label,
label: labelMap[elem.label],
value: cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, registrationStore.passPhrase, registrationStore.pubKey).split(':')[1]
value: cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, this.passPhrase, this.pubKey).split(':')[1]
}))
}