Prefetch feed refreshes to speed up 'load more posts'

This commit is contained in:
Paul Frazee 2022-12-16 15:37:13 -06:00
parent 4ef3afb604
commit d7e71e079f
3 changed files with 25 additions and 6 deletions

View file

@ -38,7 +38,6 @@ export function AutoSizedImage({
Image.getSize(
uri,
(width: number, height: number) => {
console.log('gotSize')
if (!aborted) {
setImgInfo({width, height})
}

View file

@ -51,6 +51,7 @@ export const Home = observer(function Home({
if (hasSetup) {
console.log('Updating home feed')
store.me.mainFeed.update()
doPoll()
} else {
store.nav.setTitle(navIdx, 'Home')
console.log('Fetching home feed')
@ -88,7 +89,7 @@ export const Home = observer(function Home({
onPressTryAgain={onPressTryAgain}
onScroll={onMainScroll}
/>
{store.me.mainFeed.hasNewLatest ? (
{store.me.mainFeed.hasNewLatest && !store.me.mainFeed.isRefreshing ? (
<TouchableOpacity
style={[
styles.loadLatest,