From: Ardis Lu Date: Sat, 7 Dec 2024 07:03:23 +0000 (-0800) Subject: Allow leading and trailing whitespace in safe address X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e661047eb6fb6cb302b109588c085ee71a750db7;p=safe-owners Allow leading and trailing whitespace in safe address Useful when copying addresses from documents, which sometimes adds a trailing space. --- diff --git a/index.html b/index.html index 70cfe9a..3d74fdc 100644 --- a/index.html +++ b/index.html @@ -160,7 +160,7 @@
- + @@ -264,7 +264,7 @@ const { safe, rpc } = Object.fromEntries(new FormData(e.target)); tree.innerHTML = ''; allAddresses.length = 0; - await insertTreeNode(tree, safe.replace(/^.+:/, '').toLowerCase(), rpc); + await insertTreeNode(tree, safe.replace(/^.+:/, '').trim().toLowerCase(), rpc); document.querySelectorAll('svg').forEach(svg => { svg.addEventListener('mouseover', e => highlightAddress(tree, svg.closest('li').textContent.substring(0, 42))); svg.addEventListener('mouseout', e => CSS.highlights.clear());