From 744a145e9f67bb6fb9dc28277d3bf53f3a5b102d Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 17 Oct 2025 20:09:20 +0200 Subject: [PATCH] fix: resolve linting errors in App.tsx and async.ts --- src/App.tsx | 9 +++++++-- src/utils/async.ts | 7 +------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a930a22e..332efa24 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -199,9 +199,13 @@ function App() { // wait for every relay send to finish. Responses still resolve the pending request. NostrConnectSigner.subscriptionMethod = pool.subscription.bind(pool) NostrConnectSigner.publishMethod = (relays: string[], event: unknown) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: any = pool.publish(relays, event as any) + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (result && typeof (result as any).subscribe === 'function') { - try { (result as any).subscribe({ complete: () => {}, error: () => {} }) } catch {} + // Subscribe to the observable but ignore completion/errors (fire-and-forget) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + try { (result as any).subscribe({ complete: () => { /* noop */ }, error: () => { /* noop */ } }) } catch { /* ignore */ } } // Return an already-resolved promise so upstream await finishes immediately return Promise.resolve() @@ -358,7 +362,8 @@ function App() { // Observable/Promise to upstream to avoid their awaiting of completion. const result = originalPublish(relays, event) if (result && typeof (result as { subscribe?: unknown }).subscribe === 'function') { - try { (result as { subscribe: (h: { complete?: () => void; error?: (e: unknown) => void }) => unknown }).subscribe({ complete: () => {}, error: () => {} }) } catch {} + // Subscribe to the observable but ignore completion/errors (fire-and-forget) + try { (result as { subscribe: (h: { complete?: () => void; error?: (e: unknown) => void }) => unknown }).subscribe({ complete: () => { /* noop */ }, error: () => { /* noop */ } }) } catch { /* ignore */ } } // If it's a Promise, simply ignore it (no await) so it resolves in the background. // Return a benign object so callers that probe for a "subscribe" property diff --git a/src/utils/async.ts b/src/utils/async.ts index 22d97c02..80dc25c1 100644 --- a/src/utils/async.ts +++ b/src/utils/async.ts @@ -28,12 +28,7 @@ export async function mapWithConcurrency( const worker = async () => { while (currentIndex < items.length) { const index = currentIndex++ - try { - results[index] = await mapper(items[index], index) - } catch (err) { - // Store error or handle as needed - throw err - } + results[index] = await mapper(items[index], index) } }