Workflow updating files of messenger
This commit is contained in:
parent
1ae1713295
commit
72cb41c9e4
@ -1657,14 +1657,18 @@
|
|||||||
else
|
else
|
||||||
return contactAddress
|
return contactAddress
|
||||||
}
|
}
|
||||||
|
function isValidEthereumAddress(address) {
|
||||||
|
return /^0x[a-fA-F0-9]{40}$/.test(address);
|
||||||
|
}
|
||||||
window.addEventListener('hashchange', e => routeTo(window.location.hash))
|
window.addEventListener('hashchange', e => routeTo(window.location.hash))
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
document.body.classList.remove('hidden')
|
document.body.classList.remove('hidden')
|
||||||
document.querySelectorAll('sm-input[data-address]').forEach(input => input.customValidation = (value) => {
|
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 {
|
return {
|
||||||
isValid: floCrypto.validateAddr(value),
|
isValid: isValidEthereumAddress(value) || floCrypto.validateAddr(value),
|
||||||
errorText: `Invalid FLO address.<br> It usually starts with "F"`
|
errorText: `Invalid address.`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
document.addEventListener('keyup', (e) => {
|
document.addEventListener('keyup', (e) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user