mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 07:34:28 +01:00
fix: resolve all linting and type errors
This commit is contained in:
@@ -68,7 +68,6 @@ const Bookmarks: React.FC<BookmarksProps> = ({ relayPool, onLogout }) => {
|
||||
setReaderContent,
|
||||
setReaderLoading,
|
||||
setIsCollapsed,
|
||||
setIsHighlightsCollapsed,
|
||||
setHighlights,
|
||||
setHighlightsLoading,
|
||||
setCurrentArticleCoordinate,
|
||||
|
||||
@@ -12,7 +12,6 @@ interface UseArticleLoaderProps {
|
||||
setReaderContent: (content: ReadableContent | undefined) => void
|
||||
setReaderLoading: (loading: boolean) => void
|
||||
setIsCollapsed: (collapsed: boolean) => void
|
||||
setIsHighlightsCollapsed: (collapsed: boolean) => void
|
||||
setHighlights: (highlights: Highlight[]) => void
|
||||
setHighlightsLoading: (loading: boolean) => void
|
||||
setCurrentArticleCoordinate: (coord: string | undefined) => void
|
||||
@@ -26,7 +25,6 @@ export function useArticleLoader({
|
||||
setReaderContent,
|
||||
setReaderLoading,
|
||||
setIsCollapsed,
|
||||
setIsHighlightsCollapsed,
|
||||
setHighlights,
|
||||
setHighlightsLoading,
|
||||
setCurrentArticleCoordinate,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RelayPool, completeOnEose } from 'applesauce-relay'
|
||||
import { lastValueFrom, takeUntil, timer, toArray, scan } from 'rxjs'
|
||||
import { RelayPool, completeOnEose, onlyEvents } from 'applesauce-relay'
|
||||
import { lastValueFrom, takeUntil, timer, tap, toArray } from 'rxjs'
|
||||
import { NostrEvent } from 'nostr-tools'
|
||||
import {
|
||||
getHighlightText,
|
||||
@@ -91,15 +91,16 @@ export const fetchHighlightsForArticle = async (
|
||||
relayPool
|
||||
.req(highlightRelays, { kinds: [9802], '#a': [articleCoordinate] })
|
||||
.pipe(
|
||||
scan((acc: NostrEvent[], event: NostrEvent) => {
|
||||
onlyEvents(),
|
||||
tap((event: NostrEvent) => {
|
||||
const highlight = processEvent(event)
|
||||
if (highlight && onHighlight) {
|
||||
onHighlight(highlight)
|
||||
}
|
||||
return [...acc, event]
|
||||
}, []),
|
||||
}),
|
||||
completeOnEose(),
|
||||
takeUntil(timer(10000))
|
||||
takeUntil(timer(10000)),
|
||||
toArray()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -112,15 +113,16 @@ export const fetchHighlightsForArticle = async (
|
||||
relayPool
|
||||
.req(highlightRelays, { kinds: [9802], '#e': [eventId] })
|
||||
.pipe(
|
||||
scan((acc: NostrEvent[], event: NostrEvent) => {
|
||||
onlyEvents(),
|
||||
tap((event: NostrEvent) => {
|
||||
const highlight = processEvent(event)
|
||||
if (highlight && onHighlight) {
|
||||
onHighlight(highlight)
|
||||
}
|
||||
return [...acc, event]
|
||||
}, []),
|
||||
}),
|
||||
completeOnEose(),
|
||||
takeUntil(timer(10000))
|
||||
takeUntil(timer(10000)),
|
||||
toArray()
|
||||
)
|
||||
)
|
||||
console.log('📊 Highlights via e-tag:', eTagEvents.length)
|
||||
@@ -202,7 +204,8 @@ export const fetchHighlights = async (
|
||||
relayPool
|
||||
.req(relayUrls, { kinds: [9802], authors: [pubkey] })
|
||||
.pipe(
|
||||
scan((acc: NostrEvent[], event: NostrEvent) => {
|
||||
onlyEvents(),
|
||||
tap((event: NostrEvent) => {
|
||||
if (!seenIds.has(event.id)) {
|
||||
seenIds.add(event.id)
|
||||
|
||||
@@ -235,10 +238,10 @@ export const fetchHighlights = async (
|
||||
onHighlight(highlight)
|
||||
}
|
||||
}
|
||||
return [...acc, event]
|
||||
}, []),
|
||||
}),
|
||||
completeOnEose(),
|
||||
takeUntil(timer(10000))
|
||||
takeUntil(timer(10000)),
|
||||
toArray()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user