Bug fixes

This commit is contained in:
sairaj mote 2023-04-02 03:04:27 +05:30
parent 4426493304
commit c5208b0600
3 changed files with 19 additions and 5 deletions

View File

@ -106,12 +106,27 @@
const { validFrom, validTo, issuedBy, revokedBy } = floGlobals.approvedKyc[address];
const validFromFormatted = getFormattedTime(validFrom, 'date-only');
const validToFormatted = getFormattedTime(validTo, 'date-only');
const floID = floCrypto.toFloID(address)
const btcID = btcOperator.convert.legacy2bech(floID)
if (validFrom <= Date.now() && Date.now() <= validTo) {
getRef('verification_result').dataset.status = 'valid';
renderElem(getRef('verification_result'), html`
<div class="grid justify-items-center text-center gap-0-5" style="margin: 2rem">
<svg class='icon' xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M23,12l-2.44-2.79l0.34-3.69l-3.61-0.82L15.4,1.5L12,2.96L8.6,1.5L6.71,4.69L3.1,5.5L3.44,9.2L1,12l2.44,2.79l-0.34,3.7 l3.61,0.82L8.6,22.5l3.4-1.47l3.4,1.46l1.89-3.19l3.61-0.82l-0.34-3.69L23,12z M10.09,16.72l-3.8-3.81l1.48-1.48l2.32,2.33 l5.85-5.87l1.48,1.48L10.09,16.72z"/></g></svg>
<h4>Verified KYC</h4>
<h4>KYC successfully verified</h4>
</div>
<div class="info flex gap-0-5 flex-wrap">
<span>Address</span>
<div class="grid gap-0-5">
<span>
BTC:
<sm-copy value=${btcID} clip-text></sm-copy>
</span>
<span>
FLO:
<sm-copy value=${floID} clip-text></sm-copy>
</span>
</div>
</div>
<div class="info flex gap-0-5 flex-wrap">
<span>Issued by</span>
@ -164,7 +179,7 @@
renderElem(getRef('verification_result'), html`
<div class="grid justify-items-center text-center gap-0-5" style="margin: 2rem">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>
<h4>KYC not found</h4>
<h4>KYC data not found</h4>
</div>
`);
getRef('verification_result').dataset.status = 'invalid';

View File

@ -451,10 +451,8 @@
const uniqueAddresses = new Set()
addresses.forEach(address => {
let equivalentBtcAddress = address
if (getRef('manage_type').value === 'aggregator' && floCrypto.validateFloID(address))
if (floCrypto.validateFloID(address))
equivalentBtcAddress = btcOperator.convert.legacy2bech(address)
else
equivalentBtcAddress = floCrypto.toFloID(address)
uniqueAddresses.add(equivalentBtcAddress)
})
return [...uniqueAddresses]

View File

@ -219,6 +219,7 @@ function getApprovedKycs() {
});
break;
case 'REVOKE_KYC':
console.log(operationData)
operationData.split(',').forEach(address => {
if (!floGlobals.approvedKyc[address]) return
floGlobals.approvedKyc[address].validTo = time * 1000;