chore: remediate pygienium audit findings

Dead code: 77 verified-unused exports, files (BackArrow, MenuBars,
cookies.ts, db/create.ts, schemas/comment.ts, security-headers.ts) and
12 unused dependencies removed
Comments: ~370 RESTATE comments stripped across 53 files; 2 verbose
blocks tightened; dead commented-out config removed
Complexity: bulkUpsert extracted into 11 per-entity helpers (CCN 156->~10);
login formHandler split into 3 submitters (CCN 63->~5); account page render
split into 8 section components (CCN 40); updatePost SQL builder rebuilt;
assert*Owned consolidated behind generic assertOwnedBy
Defensive guards: 4 redundant rethrow/nullish guards removed
This commit is contained in:
2026-08-11 13:36:18 -04:00
parent 33ca9213f2
commit 898c891bd5
76 changed files with 1437 additions and 2600 deletions

View File

@@ -17,7 +17,6 @@ function MainDownloadsPage() {
const [gazeText, setGazeText] = createSignal("Gaze");
const [inputHaloText, setInputHaloText] = createSignal("InputHalo");
// Track loading states for each download button
const [loadingState, setLoadingState] = createSignal<Record<string, boolean>>(
{
lineage: false,
@@ -32,10 +31,8 @@ function MainDownloadsPage() {
// Prevent multiple rapid clicks
if (loadingState()[assetName]) return;
// Set loading state
setLoadingState((prev) => ({ ...prev, [assetName]: true }));
// Call the tRPC endpoint directly
import("~/lib/api").then(({ api }) => {
api.downloads.getDownloadUrl
.query({ asset_name: assetName })
@@ -45,11 +42,9 @@ function MainDownloadsPage() {
})
.catch((error) => {
console.error("Download error:", error);
// Optionally show user a message
alert("Failed to initiate download. Please try again.");
})
.finally(() => {
// Reset loading state regardless of success/failure
setLoadingState((prev) => ({ ...prev, [assetName]: false }));
});
});