@@ -15,7 +15,7 @@ const Profile = observer (() => {
|
|||||||
value: '',
|
value: '',
|
||||||
seed: String(Math.floor(Math.random() * 90000000000000000000), 10),
|
seed: String(Math.floor(Math.random() * 90000000000000000000), 10),
|
||||||
};
|
};
|
||||||
|
|
||||||
const [sidebarOpen, setSidebarOpen] = useState(false);
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
||||||
const [buttonPanelOpen, setButtonPanelOpen] = useState(true);
|
const [buttonPanelOpen, setButtonPanelOpen] = useState(true);
|
||||||
const [removePanelOpen, setRemovePanelOpen] = useState(false);
|
const [removePanelOpen, setRemovePanelOpen] = useState(false);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function ProfileTable({
|
|||||||
image={defaultData.image}
|
image={defaultData.image}
|
||||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||||
property={data.label}
|
property={data.label}
|
||||||
status={defaultData.status}
|
status={data.status}
|
||||||
transactions={defaultData.transactions}
|
transactions={defaultData.transactions}
|
||||||
avatars={defaultData.avatars}
|
avatars={defaultData.avatars}
|
||||||
handleClick={handleClick}
|
handleClick={handleClick}
|
||||||
@@ -69,7 +69,7 @@ function ProfileTable({
|
|||||||
image={defaultData.image}
|
image={defaultData.image}
|
||||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||||
property={data.label}
|
property={data.label}
|
||||||
status={defaultData.status}
|
status={data.status}
|
||||||
transactions={defaultData.transactions}
|
transactions={defaultData.transactions}
|
||||||
avatars={defaultData.avatars}
|
avatars={defaultData.avatars}
|
||||||
handleClick={handleClick}
|
handleClick={handleClick}
|
||||||
@@ -95,7 +95,7 @@ function ProfileTable({
|
|||||||
image={defaultData.image}
|
image={defaultData.image}
|
||||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||||
property={data.label}
|
property={data.label}
|
||||||
status={defaultData.status}
|
status={data.status}
|
||||||
transactions={defaultData.transactions}
|
transactions={defaultData.transactions}
|
||||||
avatars={defaultData.avatars}
|
avatars={defaultData.avatars}
|
||||||
handleClick={handleClick}
|
handleClick={handleClick}
|
||||||
@@ -121,7 +121,7 @@ function ProfileTable({
|
|||||||
image={defaultData.image}
|
image={defaultData.image}
|
||||||
value={data.value}
|
value={data.value}
|
||||||
property={data.label}
|
property={data.label}
|
||||||
status={defaultData.status}
|
status={data.status}
|
||||||
transactions={defaultData.transactions}
|
transactions={defaultData.transactions}
|
||||||
avatars={defaultData.avatars}
|
avatars={defaultData.avatars}
|
||||||
handleClick={handleClick}
|
handleClick={handleClick}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function ProfileTableItem(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<tr className={`${props.status !== 'Progress' || 'bg-[#eaf0f6]'}`}>
|
<tr>
|
||||||
<td className="pl-4 pr-4 py-3 whitespace-nowrap w-px">
|
<td className="pl-4 pr-4 py-3 whitespace-nowrap w-px">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<label className="inline-flex">
|
<label className="inline-flex">
|
||||||
@@ -19,18 +19,18 @@ function ProfileTableItem(props) {
|
|||||||
<div className="w-9 h-9 shrink-0 mr-2 sm:mr-4">
|
<div className="w-9 h-9 shrink-0 mr-2 sm:mr-4">
|
||||||
<img className="rounded-full" src={props.image} width="40" height="40" alt={props.property} />
|
<img className="rounded-full" src={props.image} width="40" height="40" alt={props.property} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col w-60">
|
<div className="flex flex-col w-60">
|
||||||
<div className="font-semibold text-slate-800 text-base">{props.value}</div>
|
<div className="font-semibold text-slate-800 text-base">{props.status==='Blockchained'?`${props.value.slice(0,4)}****${props.value.slice(props.value.length-4)}`:props.value}</div>
|
||||||
<div className="font-normal text-xxs">{props.property}</div>
|
<div className="font-normal text-xxs">{props.property}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="py-3 whitespace-nowrap w-px">
|
<td className="py-3 whitespace-nowrap w-px">
|
||||||
<div className="w-fit text-xs inline-flex font-medium px-2.5 py-1">
|
<div className="w-fit text-xs inline-flex font-medium px-2.5 py-1">
|
||||||
{(props.status === 'Progress') ? (
|
{(props.status === 'Blockchained') ? (
|
||||||
<div className="bg-amber-100 text-amber-600 rounded-full text-center px-2.5 py-1">
|
<div className="bg-amber-100 text-amber-600 rounded-full text-center px-2.5 py-1">
|
||||||
{props.status}
|
{props.status}
|
||||||
</div>) :
|
</div>) :
|
||||||
(props.status === 'Stored') ? (
|
(props.status === 'Stored') ? (
|
||||||
<div className="bg-slate-700 text-slate-100 rounded-full text-center px-2.5 py-1">
|
<div className="bg-slate-700 text-slate-100 rounded-full text-center px-2.5 py-1">
|
||||||
{props.status}
|
{props.status}
|
||||||
@@ -89,7 +89,7 @@ function ProfileTableItem(props) {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className={`${!descriptionOpen && 'hidden'} ${props.status !== 'Progress' || 'bg-[#eaf0f6]'}` }>
|
<tr className={`${!descriptionOpen && 'hidden'}` }>
|
||||||
<td colSpan="10" className="px-12 pt-3.5 pb-[14px]">
|
<td colSpan="10" className="px-12 pt-3.5 pb-[14px]">
|
||||||
<div className="flex items-center gap-x-5">
|
<div className="flex items-center gap-x-5">
|
||||||
<div>
|
<div>
|
||||||
@@ -139,7 +139,7 @@ function ProfileTableItem(props) {
|
|||||||
Explore ->
|
Explore ->
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -213,12 +213,44 @@ class Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get decryptedAccountData() {
|
get decryptedAccountData() {
|
||||||
return this._accountData.map((elem) => {
|
const allAccountData=this._accountData.concat(this.accountFeatures.filter(item=>!this._accountData.find(elem=>elem.label===item.label)))
|
||||||
const [seed, value] = cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, this.passPhrase, this.pubKey).split(':');
|
return allAccountData.map((elem) => {
|
||||||
return {
|
const initialData={
|
||||||
...elem,
|
...elem,
|
||||||
key: elem.label,
|
key: elem.label,
|
||||||
label: labelMap[elem.label] || elem.label,
|
label: labelMap[elem.label] || elem.label,
|
||||||
|
status: '',
|
||||||
|
value: '',
|
||||||
|
seed: ''
|
||||||
|
}
|
||||||
|
if(!this._accountData.find(item=>item.label===elem.label)) {
|
||||||
|
return {
|
||||||
|
...initialData,
|
||||||
|
status: 'Blockchained',
|
||||||
|
value: elem.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const [seed, value] = cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, this.passPhrase, this.pubKey).split(':');
|
||||||
|
const hashValue=cryptography.hash(Buffer.concat([Buffer.from(seed, 'utf8'), cryptography.hash(value, 'utf8')])).toString('hex')
|
||||||
|
if(!this.accountFeatures.find(item=>item.label===elem.label)) {
|
||||||
|
return {
|
||||||
|
...initialData,
|
||||||
|
status: 'Stored',
|
||||||
|
value,
|
||||||
|
seed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.accountFeatures.find(item=>item.label===elem.label).value!==hashValue) {
|
||||||
|
return {
|
||||||
|
...initialData,
|
||||||
|
status: 'Incorrect',
|
||||||
|
value,
|
||||||
|
seed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...initialData,
|
||||||
|
status: 'Completed',
|
||||||
value,
|
value,
|
||||||
seed
|
seed
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user