diff --git a/src/pages/digitalId/ProfileId.jsx b/src/pages/digitalId/ProfileId.jsx index 6a00234..fae4309 100644 --- a/src/pages/digitalId/ProfileId.jsx +++ b/src/pages/digitalId/ProfileId.jsx @@ -10,10 +10,10 @@ import Image from '../../images/transactions-image-04.svg'; const defaultValues = { label: '', value: '', - seed: parseInt(Math.floor(Math.random() * 90000000000000000000), 10) + seed: String(Math.floor(Math.random() * 90000000000000000000), 10) }; -const initialPropertyValues = ['First name', 'Second name', 'Birthdate', 'Gender', 'National doctype', 'National doc id', 'National doc issue date', 'National doc expiry date']; +const initialPropertyValues = ['First name', 'Second name', 'Birthdate', 'Gender', 'National doctype', 'National doc ID', 'National doc issue date', 'National doc expiry date']; const Profile = observer (() => { const [sidebarOpen, setSidebarOpen] = useState(false); @@ -52,18 +52,24 @@ const Profile = observer (() => { ) }; - const closeHint = (element) => { + const selectHint = (element) => { changeAddedValues(element, 'label'); setPropertyValues([]); } + const closeHint = (eventTarget) => { + if (!eventTarget || eventTarget.tabIndex !== -1) { + setPropertyValues([]); + } + }; + const handleSelectedItems = (selectedItems) => { setSelectedItems([...selectedItems]); setUpdatedValues(userDataStore.decryptedData.filter(({ key }) => selectedItems.includes(key)) .map(elem => ( (!elem.seed) ? { ...elem, - seed: parseInt(Math.floor(Math.random() * 90000000000000000000), 10) + seed: String(Math.floor(Math.random() * 90000000000000000000), 10) }: elem))); if (selectedItems.length > 0) { setButtonPanelOpen(false); @@ -88,7 +94,7 @@ const Profile = observer (() => { const sendAddedData = () => { const checkingAddedData = !userDataStore.decryptedData - some((element) => element.label === addedValues.label) && (addedValues.seed.length === 20); + .some((element) => element.label === addedValues.label) && (addedValues.seed.length === 20); if (checkingAddedData) { setAddPanelOpen(false); setButtonPanelOpen(true); @@ -226,57 +232,55 @@ const Profile = observer (() => {