fix: resolve all linting and type checking issues

This commit is contained in:
Gigi
2025-10-21 08:21:36 +02:00
parent a5d2ed8b07
commit 8c0b73ad0c
5 changed files with 18 additions and 18 deletions

View File

@@ -455,7 +455,7 @@ const Explore: React.FC<ExploreProps> = ({ relayPool, eventStore, settings, acti
const level: 'mine' | 'friends' | 'nostrverse' = isMine ? 'mine' : isFriend ? 'friends' : 'nostrverse'
return { ...post, level }
})
}, [uniqueSortedPosts, activeAccount, followedPubkeys, visibility])
}, [uniqueSortedPosts, activeAccount, followedPubkeys, visibility, settings?.hideBotArticlesByName])
// Helper to get reading progress for a post
const getReadingProgress = useCallback((post: BlogPostPreview): number | undefined => {

View File

@@ -205,15 +205,15 @@ const Me: React.FC<MeProps> = ({
}, [viewingPubkey, relayPool, eventStore, refreshTrigger])
// Tab-specific loading functions
const loadHighlightsTab = async () => {
const loadHighlightsTab = useCallback(async () => {
if (!viewingPubkey) return
// Highlights come from controller subscription (sync effect handles it)
setLoadedTabs(prev => new Set(prev).add('highlights'))
setLoading(false)
}
}, [viewingPubkey])
const loadWritingsTab = async () => {
const loadWritingsTab = useCallback(async () => {
if (!viewingPubkey) return
try {
@@ -230,9 +230,9 @@ const Me: React.FC<MeProps> = ({
console.error('Failed to load writings:', err)
setLoading(false)
}
}
}, [viewingPubkey, relayPool, eventStore, refreshTrigger])
const loadReadingListTab = async () => {
const loadReadingListTab = useCallback(async () => {
if (!viewingPubkey || !activeAccount) return
const hasBeenLoaded = loadedTabs.has('reading-list')
@@ -246,9 +246,9 @@ const Me: React.FC<MeProps> = ({
} finally {
if (!hasBeenLoaded) setLoading(false)
}
}
}, [viewingPubkey, activeAccount, loadedTabs])
const loadReadsTab = async () => {
const loadReadsTab = useCallback(async () => {
if (!viewingPubkey || !activeAccount) return
const hasBeenLoaded = loadedTabs.has('reads')
@@ -270,9 +270,9 @@ const Me: React.FC<MeProps> = ({
console.error('Failed to load reads:', err)
if (!hasBeenLoaded) setLoading(false)
}
}
}, [viewingPubkey, activeAccount, loadedTabs, relayPool, eventStore])
const loadLinksTab = async () => {
const loadLinksTab = useCallback(async () => {
if (!viewingPubkey || !activeAccount) return
const hasBeenLoaded = loadedTabs.has('links')
@@ -310,7 +310,7 @@ const Me: React.FC<MeProps> = ({
console.error('Failed to load links:', err)
if (!hasBeenLoaded) setLoading(false)
}
}
}, [viewingPubkey, activeAccount, loadedTabs, bookmarks, relayPool, readingProgressMap])
// Load active tab data
const loadActiveTab = useCallback(() => {
@@ -346,7 +346,7 @@ const Me: React.FC<MeProps> = ({
loadLinksTab()
break
}
}, [viewingPubkey, activeTab, bookmarks, refreshTrigger])
}, [viewingPubkey, activeTab, loadHighlightsTab, loadWritingsTab, loadReadingListTab, loadReadsTab, loadLinksTab])
useEffect(() => {
loadActiveTab()

View File

@@ -163,7 +163,10 @@ export function useExternalUrlLoader({
setReaderLoading,
setIsCollapsed,
setSelectedUrl,
setHighlights
setHighlights,
setCurrentArticleCoordinate,
setCurrentArticleEventId,
setHighlightsLoading
])
// Keep UI highlights synced with cached store updates without reloading content

View File

@@ -153,7 +153,7 @@ export const useReadingPosition = ({
clearTimeout(completionTimerRef.current)
}
}
}, [enabled, onPositionChange, onReadingComplete, readingCompleteThreshold, scheduleSave])
}, [enabled, onPositionChange, onReadingComplete, readingCompleteThreshold, scheduleSave, completionHoldMs])
// Reset reading complete state when enabled changes
useEffect(() => {

View File

@@ -19,7 +19,6 @@ export async function loadUserRelayList(
): Promise<UserRelayInfo[]> {
try {
const startTime = Date.now()
// Try querying with streaming callback for faster results
const events: NostrEvent[] = []
@@ -61,10 +60,8 @@ export async function loadUserRelayList(
// Use the streaming results if we got any, otherwise fall back to the full result
const finalEvents = events.length > 0 ? events : result
const queryTime = Date.now() - startTime
// Also try a broader query to see if we get any events at all
const allEvents = await queryEvents(relayPool, {
await queryEvents(relayPool, {
kinds: [10002],
limit: 5
})