Skip to content

Commit

Permalink
optmize
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomet committed Dec 22, 2024
1 parent f46a941 commit cabee73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ AVAILABLE_CHAINS.forEach((data, chainId) => {
// Add to the list
fileList.push({
chainId,
name: data.name,
fileName,
url: fileName,
name: data.name // Only the name is needed
});
});

Expand Down
6 changes: 3 additions & 3 deletions view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ <h2>JSON Viewer</h2>
data.forEach(chain => {
const li = document.createElement("li");
const link = document.createElement("a");
link.href = chain.url;
link.textContent = chain.name;
link.href = `${chain.chainId}.json`; // Derive the URL from chainId
link.textContent = chain.name; // Use the name as the label
link.onclick = (e) => {
e.preventDefault(); // Prevent navigation
fetchJSONByUrl(chain.url);
fetchJSONByUrl(`${chain.chainId}.json`);
};
li.appendChild(link);
chainList.appendChild(li);
Expand Down

0 comments on commit cabee73

Please sign in to comment.