appview-less bluesky client
24
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix load new posts not working properly in replies & following timelines

dawn a2b7593b 6b55e412

+2 -11
+2 -11
src/components/GenericTimelineView.svelte
··· 50 50 51 51 let isAtTop = $state(true); 52 52 let boundaryTime = $state<number | null>(null); 53 - let virtualList = $state<VirtualList | null>(null); 54 - let scrollToIndex = $state<number | undefined>(undefined); 55 53 56 54 const visibleThreads = $derived.by(() => { 57 55 if (boundaryTime === null) return threads; ··· 62 60 timelineId; 63 61 displayCount = 15; 64 62 measuredHeights = []; 65 - scrollToIndex = undefined; 66 63 }); 67 64 68 65 // const renderedThreads = $derived(visibleThreads.slice(0, displayCount)); 69 66 70 67 $effect(() => { 71 - if (threads.length > 0) { 72 - if (isAtTop) boundaryTime = threads[0].newestTime; 73 - else if (boundaryTime === null) boundaryTime = threads[0].newestTime; 74 - } 68 + if (threads.length > 0 && boundaryTime === null) boundaryTime = threads[0].newestTime; 75 69 }); 76 70 77 71 const showNewPosts = () => { 78 72 boundaryTime = threads[0]?.newestTime ?? null; 79 - // @ts-ignore 80 - virtualList?.scrollToIndex(0); 73 + window.scrollTo({ top: 0, behavior: 'instant' }); 81 74 isAtTop = true; 82 75 }; 83 76 ··· 194 187 {#if isLoggedIn} 195 188 {#key timelineId} 196 189 <VirtualList 197 - bind:this={virtualList} 198 190 height="100%" 199 191 itemCount={visibleThreads.length} 200 192 itemSize={itemHeights} 201 193 estimatedItemSize={averageHeight} 202 194 onAfterScroll={onScroll} 203 - scrollToIndex={visibleThreads.length > 0 ? scrollToIndex : undefined} 204 195 > 205 196 {#snippet item({ index, style }: { index: number; style: string })} 206 197 {@const thread = renderItem(index)}