Workflow updating files of messenger

This commit is contained in:
RanchiMall Dev 2023-12-20 19:25:25 +00:00
parent 1ae1713295
commit 72cb41c9e4

View File

@ -1657,14 +1657,18 @@
else
return contactAddress
}
function isValidEthereumAddress(address) {
return /^0x[a-fA-F0-9]{40}$/.test(address);
}
window.addEventListener('hashchange', e => routeTo(window.location.hash))
window.addEventListener("load", () => {
document.body.classList.remove('hidden')
document.querySelectorAll('sm-input[data-address]').forEach(input => input.customValidation = (value) => {
if (!value) return { isValid: false, errorText: 'Please enter a FLO address' }
if (!value) return { isValid: false, errorText: 'Please enter an address' }
return {
isValid: floCrypto.validateAddr(value),
errorText: `Invalid FLO address.<br> It usually starts with "F"`
isValid: isValidEthereumAddress(value) || floCrypto.validateAddr(value),
errorText: `Invalid address.`
}
})
document.addEventListener('keyup', (e) => {