mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 16:06:32 +00:00
fix: open a list mail without mounting every pane before it #67
The tap fix makes a notification open a single page, so the viewer no longer needs to render up to the opened index. That setting mounted about N mail panes on every list open, on iOS too. Also drop the onScrollToIndexFailed handler, which FlatList never calls when getItemLayout is set.
This commit is contained in:
@@ -772,17 +772,12 @@ function EmailViewer({ route, navigation }: Props) {
|
||||
initialScrollIndex={initialIndexRef.current}
|
||||
getItemLayout={(_, index) => ({ length: windowWidth, offset: windowWidth * index, index })}
|
||||
windowSize={3}
|
||||
initialNumToRender={Math.max(initialIndexRef.current + 1, 1)}
|
||||
initialNumToRender={1}
|
||||
maxToRenderPerBatch={2}
|
||||
removeClippedSubviews
|
||||
scrollEnabled={!pagerLocked && kbObstruction === 0}
|
||||
onScrollBeginDrag={releaseNeighbours}
|
||||
onMomentumScrollEnd={onMomentumEnd}
|
||||
onScrollToIndexFailed={(info) => {
|
||||
setTimeout(() => {
|
||||
listRef.current?.scrollToOffset({ offset: info.index * windowWidth, animated: false });
|
||||
}, 50);
|
||||
}}
|
||||
renderItem={({ item, index }) => (
|
||||
<View style={{ width: windowWidth }}>
|
||||
<EmailPane
|
||||
|
||||
Reference in New Issue
Block a user