Skip to content

Commit

Permalink
ひとまず messaging のみ対応してみた
Browse files Browse the repository at this point in the history
  • Loading branch information
blaue-fuchs committed Sep 13, 2024
1 parent 36d2622 commit 161799c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/messaging/main.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ document.addEventListener('DOMContentLoaded', async () => {
if (statsDiv && statsReportJsonDiv) {
let statsHtml = ''
const statsReportJson: Record<string, unknown>[] = []
// biome-ignore lint/complexity/noForEach: <explanation>
statsReport.forEach((report) => {
for (const [report_id, report] of statsReport) {
statsHtml += `<h3>Type: ${report.type}</h3><ul>`
const reportJson: Record<string, unknown> = { id: report.id, type: report.type }
const reportJson: Record<string, unknown> = { id: report_id, type: report.type }
for (const [key, value] of Object.entries(report)) {
if (key !== 'type' && key !== 'id') {
statsHtml += `<li><strong>${key}:</strong> ${value}</li>`
Expand All @@ -51,7 +50,7 @@ document.addEventListener('DOMContentLoaded', async () => {
}
statsHtml += '</ul>'
statsReportJson.push(reportJson)
})
}
statsDiv.innerHTML = statsHtml
// データ属性としても保存(オプション)
statsDiv.dataset.statsReportJson = JSON.stringify(statsReportJson)
Expand Down

0 comments on commit 161799c

Please sign in to comment.