fix: resolve all linting and type errors

This commit is contained in:
Gigi
2025-10-05 22:45:57 +01:00
parent 41fb51c357
commit c07797ff7c
3 changed files with 17 additions and 17 deletions

View File

@@ -68,7 +68,6 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
setReaderContent, setReaderContent,
setReaderLoading, setReaderLoading,
setIsCollapsed, setIsCollapsed,
setIsHighlightsCollapsed,
setHighlights, setHighlights,
setHighlightsLoading, setHighlightsLoading,
setCurrentArticleCoordinate, setCurrentArticleCoordinate,

View File

@@ -12,7 +12,6 @@ interface UseArticleLoaderProps {
setReaderContent: (content: ReadableContent | undefined) => void setReaderContent: (content: ReadableContent | undefined) => void
setReaderLoading: (loading: boolean) => void setReaderLoading: (loading: boolean) => void
setIsCollapsed: (collapsed: boolean) => void setIsCollapsed: (collapsed: boolean) => void
setIsHighlightsCollapsed: (collapsed: boolean) => void
setHighlights: (highlights: Highlight[]) => void setHighlights: (highlights: Highlight[]) => void
setHighlightsLoading: (loading: boolean) => void setHighlightsLoading: (loading: boolean) => void
setCurrentArticleCoordinate: (coord: string | undefined) => void setCurrentArticleCoordinate: (coord: string | undefined) => void
@@ -26,7 +25,6 @@ export function useArticleLoader({
setReaderContent, setReaderContent,
setReaderLoading, setReaderLoading,
setIsCollapsed, setIsCollapsed,
setIsHighlightsCollapsed,
setHighlights, setHighlights,
setHighlightsLoading, setHighlightsLoading,
setCurrentArticleCoordinate, setCurrentArticleCoordinate,

View File

@@ -1,5 +1,5 @@
import { RelayPool, completeOnEose } from 'applesauce-relay' import { RelayPool, completeOnEose, onlyEvents } from 'applesauce-relay'
import { lastValueFrom, takeUntil, timer, toArray, scan } from 'rxjs' import { lastValueFrom, takeUntil, timer, tap, toArray } from 'rxjs'
import { NostrEvent } from 'nostr-tools' import { NostrEvent } from 'nostr-tools'
import { import {
getHighlightText, getHighlightText,
@@ -91,15 +91,16 @@ export const fetchHighlightsForArticle = async (
relayPool relayPool
.req(highlightRelays, { kinds: [9802], '#a': [articleCoordinate] }) .req(highlightRelays, { kinds: [9802], '#a': [articleCoordinate] })
.pipe( .pipe(
scan((acc: NostrEvent[], event: NostrEvent) => { onlyEvents(),
tap((event: NostrEvent) => {
const highlight = processEvent(event) const highlight = processEvent(event)
if (highlight && onHighlight) { if (highlight && onHighlight) {
onHighlight(highlight) onHighlight(highlight)
} }
return [...acc, event] }),
}, []),
completeOnEose(), completeOnEose(),
takeUntil(timer(10000)) takeUntil(timer(10000)),
toArray()
) )
) )
@@ -112,15 +113,16 @@ export const fetchHighlightsForArticle = async (
relayPool relayPool
.req(highlightRelays, { kinds: [9802], '#e': [eventId] }) .req(highlightRelays, { kinds: [9802], '#e': [eventId] })
.pipe( .pipe(
scan((acc: NostrEvent[], event: NostrEvent) => { onlyEvents(),
tap((event: NostrEvent) => {
const highlight = processEvent(event) const highlight = processEvent(event)
if (highlight && onHighlight) { if (highlight && onHighlight) {
onHighlight(highlight) onHighlight(highlight)
} }
return [...acc, event] }),
}, []),
completeOnEose(), completeOnEose(),
takeUntil(timer(10000)) takeUntil(timer(10000)),
toArray()
) )
) )
console.log('📊 Highlights via e-tag:', eTagEvents.length) console.log('📊 Highlights via e-tag:', eTagEvents.length)
@@ -202,7 +204,8 @@ export const fetchHighlights = async (
relayPool relayPool
.req(relayUrls, { kinds: [9802], authors: [pubkey] }) .req(relayUrls, { kinds: [9802], authors: [pubkey] })
.pipe( .pipe(
scan((acc: NostrEvent[], event: NostrEvent) => { onlyEvents(),
tap((event: NostrEvent) => {
if (!seenIds.has(event.id)) { if (!seenIds.has(event.id)) {
seenIds.add(event.id) seenIds.add(event.id)
@@ -235,10 +238,10 @@ export const fetchHighlights = async (
onHighlight(highlight) onHighlight(highlight)
} }
} }
return [...acc, event] }),
}, []),
completeOnEose(), completeOnEose(),
takeUntil(timer(10000)) takeUntil(timer(10000)),
toArray()
) )
) )