Prevent user from uploading same doc again
This commit is contained in:
parent
f83b74ec2c
commit
c9baa64cf9
24
index.html
24
index.html
@ -628,12 +628,14 @@
|
|||||||
let isVerified = false;
|
let isVerified = false;
|
||||||
let concurrentRequests = 0;
|
let concurrentRequests = 0;
|
||||||
const requests = floDapps.getNextGeneralData('userKycRequests', '0');
|
const requests = floDapps.getNextGeneralData('userKycRequests', '0');
|
||||||
|
let hasUploaded = {}
|
||||||
const renderedRequests = Object.keys(requests).reverse().map((key) => {
|
const renderedRequests = Object.keys(requests).reverse().map((key) => {
|
||||||
const { time, tag, message: { docType } } = requests[key];
|
const { time, tag, message: { docType } } = requests[key];
|
||||||
if (!isVerified && tag === 'verified')
|
if (!isVerified && tag === 'verified')
|
||||||
isVerified = true;
|
isVerified = true;
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
concurrentRequests++;
|
concurrentRequests++;
|
||||||
|
hasUploaded[docType] = true;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<li class="verification-item">
|
<li class="verification-item">
|
||||||
@ -650,7 +652,7 @@
|
|||||||
</li>
|
</li>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
return [renderedRequests, concurrentRequests, isVerified];
|
return { renderedRequests, concurrentRequests, isVerified, hasUploaded };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let userAddressTimeInterval;
|
let userAddressTimeInterval;
|
||||||
@ -728,7 +730,7 @@
|
|||||||
</label>
|
</label>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
const [renderedRequests, concurrentRequests, isVerified] = render.userRequests()
|
const { renderedRequests, concurrentRequests, isVerified, hasUploaded } = render.userRequests()
|
||||||
const fileUploadSection = html`
|
const fileUploadSection = html`
|
||||||
<section class="flex flex-direction-column gap-0-5">
|
<section class="flex flex-direction-column gap-0-5">
|
||||||
<h3 class="text-center" style="margin-bottom: 1rem">Upload document for KYC verification</h3>
|
<h3 class="text-center" style="margin-bottom: 1rem">Upload document for KYC verification</h3>
|
||||||
@ -748,18 +750,12 @@
|
|||||||
<div id="file_upload_section" class="grid gap-1 hidden card">
|
<div id="file_upload_section" class="grid gap-1 hidden card">
|
||||||
<fieldset id="file_doc_type_selector">
|
<fieldset id="file_doc_type_selector">
|
||||||
<legend>Select ID proof</legend>
|
<legend>Select ID proof</legend>
|
||||||
<label class="interact">
|
${Object.keys(docTypeNames).map((docType) => hasUploaded[docType] ? html`` : html`
|
||||||
<input type="radio" name="file_type" value="passport"/>
|
<label class="interact">
|
||||||
<span>Passport</span>
|
<input type="radio" name="file_type" value="${docType}"/>
|
||||||
</label>
|
<span>${docTypeNames[docType]}</span>
|
||||||
<label class="interact">
|
</label>
|
||||||
<input type="radio" name="file_type" value="driving_license"/>
|
`)}
|
||||||
<span>Driving License</span>
|
|
||||||
</label>
|
|
||||||
<label class="interact">
|
|
||||||
<input type="radio" name="file_type" value="aadhaar"/>
|
|
||||||
<span>Aadhaar Card</span>
|
|
||||||
</label>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="issuer_selector">
|
<fieldset id="issuer_selector">
|
||||||
<legend>Select KYC verifier</legend>
|
<legend>Select KYC verifier</legend>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user