Bug fixes

This commit is contained in:
sairaj mote 2023-09-27 19:39:38 +05:30
parent 42140d541c
commit ab12537dfe

View File

@ -1242,7 +1242,12 @@
getRef('smart_contract_creation_form').classList.remove('split-layout') getRef('smart_contract_creation_form').classList.remove('split-layout')
renderElem(getRef('smart_contract_creation_form'), render.contractCreationForm(type, subtype)) renderElem(getRef('smart_contract_creation_form'), render.contractCreationForm(type, subtype))
getRef('smart_contract_creation_form').querySelectorAll('[data-flo-address]').forEach(input => { getRef('smart_contract_creation_form').querySelectorAll('[data-flo-address]').forEach(input => {
input.customValidation = floCrypto.validateFloID input.customValidation = (value) => {
return {
isValid: floCrypto.validateAddr(value),
errorText: `Invalid FLO address.<br> It usually starts with "F".`
}
}
}) })
showChildElement('smartcontracts', 1, { entry: slideInLeft, exit: slideOutLeft }) showChildElement('smartcontracts', 1, { entry: slideInLeft, exit: slideOutLeft })
break; break;
@ -1599,8 +1604,18 @@
pagesData.lastPage = pageId pagesData.lastPage = pageId
} }
} }
document.querySelectorAll('sm-input[data-flo-address]').forEach(input => input.customValidation = floCrypto.validateFloID) document.querySelectorAll('sm-input[data-flo-address]').forEach(input => input.customValidation = (value) => {
document.querySelectorAll('sm-input[data-private-key]').forEach(input => input.customValidation = floCrypto.getPubKeyHex) return {
isValid: floCrypto.validateAddr(value),
errorText: `Invalid FLO address.<br> It usually starts with "F"`
}
})
document.querySelectorAll('sm-input[data-private-key]').forEach(input => input.customValidation = (value) => {
return {
isValid: floCrypto.getPubKeyHex(value),
errorText: `Invalid private key.<br> It's a long string of random characters usually starting with 'R'.`
}
})
} }
const indicatorObserver = new IntersectionObserver(entries => { const indicatorObserver = new IntersectionObserver(entries => {
@ -3252,7 +3267,12 @@
document.getElementById('payee_container').querySelectorAll('.payee-share').forEach((input) => { document.getElementById('payee_container').querySelectorAll('.payee-share').forEach((input) => {
input.value = parseFloat((100 / document.getElementById('payee_container').querySelectorAll('.payee-share').length).toFixed(2)) input.value = parseFloat((100 / document.getElementById('payee_container').querySelectorAll('.payee-share').length).toFixed(2))
}) })
document.getElementById('payee_container').lastElementChild.querySelector('.payee-address').customValidation = floCrypto.validateFloID document.getElementById('payee_container').lastElementChild.querySelector('.payee-address').customValidation = (value) => {
return {
isValid: floCrypto.validateAddr(value),
errorText: `Invalid FLO address.<br> It usually starts with "F".`
}
}
} }
function removePayee(e) { function removePayee(e) {
e.target.closest('li').remove() e.target.closest('li').remove()