removed scrollIndex state from redux

This commit is contained in:
Nouman Tahir 2023-03-02 18:51:24 +05:00
parent 3518bfc9e6
commit 445919cbf9
2 changed files with 1 additions and 11 deletions

View File

@ -66,7 +66,6 @@ const postsListContainer = (
const votesCache = useSelector((state) => state.cache.votesCollection);
const mutes = useSelector((state) => state.account.currentAccount.mutes);
const scrollIndex: number = useSelector(state => state.ui.scrollIndex);
const scrollPosition = useSelector((state) => {
return isFeedScreen ? state.posts.feedScrollPosition : state.posts.otherScrollPosition;
@ -258,7 +257,7 @@ const postsListContainer = (
maxToRenderPerBatch={5}
initialNumToRender={3}
windowSize={8}
extraData={[imageHeights, scrollIndex, reblogsCollectionRef.current, votesCache]}
extraData={[imageHeights, reblogsCollectionRef.current, votesCache]}
onEndReached={_onEndReached}
onMomentumScrollBegin={() => {
_onEndReachedCalledDuringMomentum = false;

View File

@ -30,7 +30,6 @@ interface UiState {
lockedOrientation: string;
replyModalVisible: boolean;
replyModalPost: any;
scrollIndex: number;
}
const initialState: UiState = {
@ -47,7 +46,6 @@ const initialState: UiState = {
lockedOrientation: orientations.PORTRAIT,
replyModalPost: null,
replyModalVisible: false,
scrollIndex:0
};
export default function (state = initialState, action): UiState {
@ -137,13 +135,6 @@ export default function (state = initialState, action): UiState {
replyModalVisible: false,
replyModalPost: null,
};
//TOOD: remove before PR, only for testing
case 'inc-scroll-index':
return {
...state,
scrollIndex:state.scrollIndex + 1
}
default:
return state;
}