Tweak post list numbers (#4105)
This commit is contained in:
parent
605c90ce61
commit
8522b70851
2 changed files with 11 additions and 10 deletions
|
|
@ -36,7 +36,7 @@ exports[`PostList setting channel deep link 1`] = `
|
|||
"minIndexForVisible": 0,
|
||||
}
|
||||
}
|
||||
maxToRenderPerBatch={5}
|
||||
maxToRenderPerBatch={10}
|
||||
numColumns={1}
|
||||
onContentSizeChange={[Function]}
|
||||
onEndReachedThreshold={2}
|
||||
|
|
@ -65,7 +65,7 @@ exports[`PostList setting channel deep link 1`] = `
|
|||
}
|
||||
}
|
||||
updateCellsBatchingPeriod={50}
|
||||
windowSize={11}
|
||||
windowSize={50}
|
||||
/>
|
||||
`;
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ exports[`PostList setting permalink deep link 1`] = `
|
|||
"minIndexForVisible": 0,
|
||||
}
|
||||
}
|
||||
maxToRenderPerBatch={5}
|
||||
maxToRenderPerBatch={10}
|
||||
numColumns={1}
|
||||
onContentSizeChange={[Function]}
|
||||
onEndReachedThreshold={2}
|
||||
|
|
@ -134,7 +134,7 @@ exports[`PostList setting permalink deep link 1`] = `
|
|||
}
|
||||
}
|
||||
updateCellsBatchingPeriod={50}
|
||||
windowSize={11}
|
||||
windowSize={50}
|
||||
/>
|
||||
`;
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ exports[`PostList should match snapshot 1`] = `
|
|||
"minIndexForVisible": 0,
|
||||
}
|
||||
}
|
||||
maxToRenderPerBatch={5}
|
||||
maxToRenderPerBatch={10}
|
||||
numColumns={1}
|
||||
onContentSizeChange={[Function]}
|
||||
onEndReachedThreshold={2}
|
||||
|
|
@ -203,6 +203,6 @@ exports[`PostList should match snapshot 1`] = `
|
|||
}
|
||||
}
|
||||
updateCellsBatchingPeriod={50}
|
||||
windowSize={11}
|
||||
windowSize={50}
|
||||
/>
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import React, {PureComponent} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {Alert, FlatList, InteractionManager, RefreshControl, StyleSheet} from 'react-native';
|
||||
import {Alert, FlatList, InteractionManager, Platform, RefreshControl, StyleSheet} from 'react-native';
|
||||
import {intlShape} from 'react-intl';
|
||||
|
||||
import EventEmitter from '@mm-redux/utils/event_emitter';
|
||||
|
|
@ -514,6 +514,7 @@ export default class PostList extends PureComponent {
|
|||
tintColor={theme.centerChannelColor}
|
||||
/>);
|
||||
|
||||
const hasPostsKey = postIds.length ? 'true' : 'false';
|
||||
return (
|
||||
<FlatList
|
||||
contentContainerStyle={styles.postListContent}
|
||||
|
|
@ -521,14 +522,14 @@ export default class PostList extends PureComponent {
|
|||
extraData={this.makeExtraData(channelId, highlightPostId, extraData, loadMorePostsVisible)}
|
||||
initialNumToRender={INITIAL_BATCH_TO_RENDER}
|
||||
inverted={true}
|
||||
key={`recyclerFor-${channelId}`}
|
||||
key={`recyclerFor-${channelId}-${hasPostsKey}`}
|
||||
keyboardDismissMode={'interactive'}
|
||||
keyboardShouldPersistTaps={'handled'}
|
||||
keyExtractor={this.keyExtractor}
|
||||
ListFooterComponent={this.props.renderFooter}
|
||||
listKey={`recyclerFor-${channelId}`}
|
||||
maintainVisibleContentPosition={SCROLL_POSITION_CONFIG}
|
||||
maxToRenderPerBatch={5}
|
||||
maxToRenderPerBatch={Platform.select({android: 5})}
|
||||
nativeID={scrollViewNativeID}
|
||||
onContentSizeChange={this.handleContentSizeChange}
|
||||
onLayout={this.handleLayout}
|
||||
|
|
@ -541,7 +542,7 @@ export default class PostList extends PureComponent {
|
|||
renderItem={this.renderItem}
|
||||
scrollEventThrottle={60}
|
||||
style={styles.flex}
|
||||
windowSize={11}
|
||||
windowSize={Platform.select({android: 11, ios: 50})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue