From: Ardis Lu Date: Sun, 25 Aug 2024 06:19:16 +0000 (-0700) Subject: Use lastChild property instead of :last-child selector X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=c3f765bdb3504a0ff40454a81f2b4e81846393e1;p=safe-owners Use lastChild property instead of :last-child selector :last-child considers the most nested child to be "last", whereas lastChild returns the last highest-level child. The latter behavior is desired, otherwise safes with multiple safes as owners will have all the child safe owners attributed to the first child safe. --- diff --git a/index.html b/index.html index 3b2058c..93f5b1d 100644 --- a/index.html +++ b/index.html @@ -250,7 +250,7 @@ allAddresses.push(safe); const newRoot = document.createElement('ul'); - root.querySelector('li:last-child').insertAdjacentElement('beforeend', newRoot); + root.lastChild.insertAdjacentElement('beforeend', newRoot); for (const owner of owners) { await insertTreeNode(newRoot, owner, rpc); }