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:
Gigi
2025-10-19 12:27:19 +02:00
parent 914738abb4
commit 0740d53d37
2 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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>()