Skip to content

Commit

Permalink
put relay status in correct box
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Sep 14, 2024
1 parent 61ab0ba commit a253f54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h2>Hash Rate:</h2>
<h2>Result:</h2>
<pre id="result">Waiting for worker to initialize...</pre>

<div id="relayStatus"></div>
<code id="relayStatus"></code>

<button id="cancelButton" disabled>Cancel Mining</button>

Expand Down
4 changes: 2 additions & 2 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ const showRelayStatus = () => {
const settled = Array(pubs.length).fill(false);
const intervalId = setInterval(() => {
settledCount = settled.filter(Boolean).length;
resultOutput.textContent = `Published to ${settledCount}/${pubs.length} relays.`
relayStatus.textContent = `Published to ${settledCount}/${pubs.length} relays.`
if (settledCount === pubs.length) {
clearInterval(intervalId);
}
}, 100);

pubs.forEach((pub, index) => {
pub.finally(() => {
resultOutput.textContent = `Published to all relays [${RELAYS.join(', ')}]`
relayStatus.textContent = `Published to all relays [${RELAYS.join(', ')}]`
settled[index] = true;
});
});
Expand Down

0 comments on commit a253f54

Please sign in to comment.