mirror of
https://github.com/dergigi/boris.git
synced 2026-01-03 23:14:36 +01:00
fix: resolve all linter warnings
- Add proper types (Filter, NostrEvent) to readingProgressController - Add eslint-disable comment for position dependency in useReadingPosition (position is derived from scroll and including it would cause infinite re-renders) - All lint warnings resolved - TypeScript type checks pass
This commit is contained in:
@@ -148,6 +148,8 @@ export const useReadingPosition = ({
|
||||
clearTimeout(saveTimerRef.current)
|
||||
}
|
||||
}
|
||||
// position is intentionally not in deps - it's computed from scroll and would cause infinite re-renders
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [enabled, onPositionChange, onReadingComplete, readingCompleteThreshold, scheduleSave])
|
||||
|
||||
// Reset reading complete state when enabled changes
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { RelayPool } from 'applesauce-relay'
|
||||
import { IEventStore } from 'applesauce-core'
|
||||
import { Filter, NostrEvent } from 'nostr-tools'
|
||||
import { queryEvents } from './dataFetch'
|
||||
import { KINDS } from '../config/kinds'
|
||||
import { RELAYS } from '../config/relays'
|
||||
@@ -134,7 +135,7 @@ class ReadingProgressController {
|
||||
const needsFullSync = force || this.currentProgressMap.size === 0
|
||||
const lastSynced = needsFullSync ? null : this.getLastSyncedAt(pubkey)
|
||||
|
||||
const filter: any = {
|
||||
const filter: Filter = {
|
||||
kinds: [KINDS.ReadingProgress],
|
||||
authors: [pubkey]
|
||||
}
|
||||
@@ -179,7 +180,7 @@ class ReadingProgressController {
|
||||
/**
|
||||
* Process events and update progress map
|
||||
*/
|
||||
private processEvents(events: any[]): void {
|
||||
private processEvents(events: NostrEvent[]): void {
|
||||
console.log('[progress] 🔄 Processing', events.length, 'events')
|
||||
|
||||
const readsMap = new Map<string, ReadItem>()
|
||||
|
||||
Reference in New Issue
Block a user