From 4cad1f9d8a0e58029d5f66fd09e9d65c5e87c981 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sat, 20 Aug 2022 23:37:31 -0700 Subject: [PATCH] Match response to name by ID instead of index --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1764db0..d2df67e 100644 --- a/index.html +++ b/index.html @@ -148,12 +148,13 @@ 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)}`; } -- 2.47.3