From a5aaa16e76c941f8066b51e89c814e2800b953eb Mon Sep 17 00:00:00 2001 From: 81reap Date: Mon, 28 Sep 2026 21:41:37 -0400 Subject: [PATCH] fix(frontend) :: remove floating promises Enables `noFloatingPromises` and adds logging for the two missing promises. --- biome.json | 7 +++++++ frontend/src/apexcharts.js | 2 +- frontend/src/sqlpage.js | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/biome.json b/biome.json index c56f9d1c..5d53a9f5 100644 --- a/biome.json +++ b/biome.json @@ -20,5 +20,12 @@ "enabled": true, "useIgnoreFile": true, "clientKind": "git" + }, + "linter": { + "rules": { + "nursery": { + "noFloatingPromises": "error" + } + } } } diff --git a/frontend/src/apexcharts.js b/frontend/src/apexcharts.js index 820a7266..8536338d 100644 --- a/frontend/src/apexcharts.js +++ b/frontend/src/apexcharts.js @@ -306,7 +306,7 @@ const sqlpage_chart = (() => { chartContainer, /** @type {import("apexcharts").ApexOptions} */ (options), ); - chart.render(); + chart.render().catch(console.error); if (window.charts) window.charts.push(chart); else window.charts = [chart]; c.removeAttribute("data-pre-init"); diff --git a/frontend/src/sqlpage.js b/frontend/src/sqlpage.js index 5f89c8da..1796828e 100644 --- a/frontend/src/sqlpage.js +++ b/frontend/src/sqlpage.js @@ -32,6 +32,10 @@ function sqlpage_card() { bubbles: true, }); c.dispatchEvent(fragLoadedEvt); + }) + .catch((e) => { + console.error(e); + c.querySelector(".card-loading-placeholder")?.remove(); }); } }