Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zkPorpoise committed Feb 27, 2024
1 parent 2dd6ab8 commit df2dce7
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions my-responses.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@
}
})
.then((output) => {
console.log("output: ", output.map(user => `<tr><td>${user.surveyroot}</td><td>${user.surveyselection}</td><td>${user.timestamp}</td></tr>`).join(''));
return output.map(user => `<tr><td>${user.surveyroot}</td><td>${user.surveyselection}</td><td>${user.timestamp}</td></tr>`).join('');
const tableBody = document.getElementById('tableBody');
output.map((user) => {
let newRow = document.createElement('tr');
newRow.innerHTML = `<td>${user.surveyroot}</td><td>${user.surveyselection}</td><td>${username.timestamp}</td>`
tableBody.appendChild(newRow);
})
})
.catch((err) => {
// TODO: put some logic here to surface the error
Expand All @@ -56,9 +60,7 @@
async function onload() {
const userFound = retrievePublicKey();
if (userFound) {
const tableContainer = document.getElementById('tableContainer');
const tableHTML = `<table><thead><tr><th>Survey Root</th><th>Survey Selection</th><th>Timestamp</th></tr></thead><tbody>${await generateTableRows()}</tbody></table>`;
tableContainer.innerHTML = tableHTML;
generateTableRows();
}
}
</script>
Expand All @@ -80,7 +82,14 @@ <h2 id="🐬">
<h2 id="🐬"> Your Responses </h2>
</div>

<div id="tableContainer"></div>
<div id="tableContainer">
<table>
<thead>
<tr><th>Survey Root</th><th>Survey Selection</th><th>Timestamp</th></tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
</div>
<footer style="position: fixed; bottom: 0; width: 100%; text-align: center;">
<p>
&copy; ⏰2024 🔮PORPOISE Network.
Expand Down

0 comments on commit df2dce7

Please sign in to comment.