]> git.ardis.lu - ens2hex/commitdiff
Match response to name by ID instead of index
authorArdis Lu <ardisglu@gmail.com>
Sun, 21 Aug 2022 06:37:31 +0000 (23:37 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 21 Aug 2022 06:37:31 +0000 (23:37 -0700)
index.html

index 1764db0f3a64545474e54306485581f53cf01347..d2df67e8feee3271197a0152fba02f8fe23050c7 100644 (file)
 
       table.querySelector('tbody')?.remove(); // Clear previous rows, if any
       const body = table.createTBody();
-      for (const [index, response] of batchResponse.entries()) {
+      for (const [index, name] of cleaned.entries()) {
         const row = body.insertRow();
         const ens = row.insertCell();
         const address = row.insertCell();
 
-        ens.textContent = cleaned[index]; // Assumes batchResponse is in the same order as cleaned
+        ens.textContent = name;
+        const response = batchResponse.find(r => r.id === index);
         address.textContent = `0x${response.result.slice(26)}`;
       }
 
This page took 0.045427 seconds and 4 git commands to generate.