From 535097cefb0df230a7b9e50b485ff788b4a0a31f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 21 Mar 2026 01:24:34 -0400 Subject: [PATCH] style(web): fix async/await formatting in library.ts Minor code formatting improvements to improve readability and consistency with TypeScript best practices. Changes (web/src/library.ts): 1. Fix async/await formatting (line 46-48): Before: const result = handleResponse(response) as unknown as LibrariesResponse; After: const result = (await handleResponse(response)) as unknown as LibrariesResponse; Properly wraps the async handleResponse call in parentheses before the type assertion, making the await precedence explicit. 2. Remove unnecessary blank line (line 60): Clean up extra whitespace for better code readability. These are pure formatting changes with no functional impact. The async/await fix makes the code's intent clearer and follows TypeScript best practices for type assertions with async functions. TypeScript: Type assertions with async functions --- web/src/library.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/library.ts b/web/src/library.ts index 43eb437..608228a 100644 --- a/web/src/library.ts +++ b/web/src/library.ts @@ -43,7 +43,9 @@ let libraries: Library[] = []; async function reloadLibraries(): Promise { try { const response = await apiGet("/libraries"); - const result = handleResponse(response) as unknown as LibrariesResponse; + const result = (await handleResponse( + response, + )) as unknown as LibrariesResponse; libraries = result.data; renderLibraries(); } catch (error) { @@ -55,7 +57,6 @@ async function reloadLibraries(): Promise { function renderLibraries(): void { const container = document.getElementById("libraries-list"); if (!container) return; - if (libraries.length === 0) { container.innerHTML = '

No libraries yet. Create your first library to get started.

';