From 6dab126f88413a65f959e23f663aa61ac1f1dfba Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 01:01:18 +0200 Subject: [PATCH] fix: resolve lint and type errors in support page implementation --- src/components/Support.tsx | 23 +++++------------------ src/services/zapReceiptService.ts | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/components/Support.tsx b/src/components/Support.tsx index 0bd86b9e..23d527d6 100644 --- a/src/components/Support.tsx +++ b/src/components/Support.tsx @@ -15,10 +15,7 @@ interface SupportProps { settings: UserSettings } -interface SupporterProfile extends ZapSender { - name?: string - picture?: string -} +type SupporterProfile = ZapSender const Support: React.FC = ({ relayPool, eventStore, settings }) => { const [supporters, setSupporters] = useState([]) @@ -33,19 +30,9 @@ const Support: React.FC = ({ relayPool, eventStore, settings }) => if (zappers.length > 0) { const pubkeys = zappers.map(z => z.pubkey) await fetchProfiles(relayPool, eventStore, pubkeys, settings) - - // Map zappers with profile data - const withProfiles = zappers.map(zapper => { - const profile = eventStore.getProfile(zapper.pubkey) - return { - ...zapper, - name: profile?.name || profile?.display_name || `${zapper.pubkey.slice(0, 8)}...`, - picture: profile?.picture - } - }) - - setSupporters(withProfiles) } + + setSupporters(zappers) } catch (error) { console.error('Failed to load supporters:', error) } finally { @@ -130,8 +117,8 @@ interface SupporterCardProps { const SupporterCard: React.FC = ({ supporter, isWhale }) => { const profile = useEventModel(Models.ProfileModel, [supporter.pubkey]) - const picture = profile?.picture || supporter.picture - const name = profile?.name || profile?.display_name || supporter.name + const picture = profile?.picture + const name = profile?.name || profile?.display_name || `${supporter.pubkey.slice(0, 8)}...` return (
diff --git a/src/services/zapReceiptService.ts b/src/services/zapReceiptService.ts index e1a5cba6..a7ca032b 100644 --- a/src/services/zapReceiptService.ts +++ b/src/services/zapReceiptService.ts @@ -86,7 +86,7 @@ export async function fetchBorisZappers( // Filter >= 2100 sats, mark whales >= 69420 sats, sort by total desc const zappers: ZapSender[] = Array.from(senderTotals.entries()) - .filter(([_, data]) => data.totalSats >= 2100) + .filter(([, data]) => data.totalSats >= 2100) .map(([pubkey, data]) => ({ pubkey, totalSats: data.totalSats,