diff --git a/app/views/RoomView/List/List.tsx b/app/views/RoomView/List/List.tsx index 17d6c3dc0..e0dcb7c2d 100644 --- a/app/views/RoomView/List/List.tsx +++ b/app/views/RoomView/List/List.tsx @@ -5,15 +5,11 @@ import { FlatListProps, StyleSheet } from 'react-native'; import { FlashList } from '@shopify/flash-list'; import Animated from 'react-native-reanimated'; -import { isIOS } from '../../../lib/methods/helpers'; import scrollPersistTaps from '../../../lib/methods/helpers/scrollPersistTaps'; const AnimatedFlatList = Animated.createAnimatedComponent(FlashList); const styles = StyleSheet.create({ - list: { - flex: 1 - }, contentContainer: { paddingTop: 10 } @@ -23,11 +19,13 @@ const styles = StyleSheet.create({ export type IListProps = FlatListProps; +// @ts-ignore const List = ({ listRef, ...props }: IListProps) => ( item.id} + // @ts-ignore contentContainerStyle={styles.contentContainer} // style={styles.list} inverted diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index 779de642b..aaeadf69b 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -15,6 +15,7 @@ import { compareServerVersion, debounce } from '../../../lib/methods/helpers'; import { animateNextTransition } from '../../../lib/methods/helpers/layoutAnimation'; import log from '../../../lib/methods/helpers/log'; import EmptyRoom from '../EmptyRoom'; +// @ts-ignore import List, { IListProps, TListRef } from './List'; import NavBottomFAB from './NavBottomFAB'; import { loadMissedMessages, loadThreadMessages } from '../../../lib/methods'; diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 0506a296e..ae253e5fe 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -78,7 +78,7 @@ import { ICustomEmojis } from '../../definitions'; import { E2E_MESSAGE_TYPE, E2E_STATUS, MESSAGE_TYPE_ANY_LOAD, MessageTypeLoad, themes } from '../../lib/constants'; -import { TListRef } from './List/List'; +// import { TListRef } from './List/List'; import { ModalStackParamList } from '../../stacks/MasterDetailStack/types'; import { callJitsi, @@ -215,7 +215,7 @@ class RoomView extends React.Component { private messagebox: React.RefObject; private list: React.RefObject; private joinCode: React.RefObject; - private flatList: TListRef; + private flatList: any; private mounted: boolean; private offset = 0; private subObserveQuery?: Subscription; diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index 5e11e55ea..c4c7fd378 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -62,7 +62,6 @@ import { hasPermission, isRead, debounce, - isIOS, isTablet } from '../../lib/methods/helpers'; import { E2E_BANNER_TYPE, DisplayMode, SortBy, MAX_SIDEBAR_WIDTH, themes } from '../../lib/constants'; @@ -118,7 +117,6 @@ interface IRoomItem extends ISubscription { outside?: boolean; } -const INITIAL_NUM_TO_RENDER = isTablet ? 20 : 12; const CHATS_HEADER = 'Chats'; const UNREAD_HEADER = 'Unread'; const FAVORITES_HEADER = 'Favorites'; @@ -159,11 +157,6 @@ const sortPreferencesShouldUpdate = ['sortBy', 'groupByType', 'showFavorites', ' const displayPropsShouldUpdate = ['showAvatar', 'displayMode']; -const getItemLayout = (data: ISubscription[] | null | undefined, index: number, height: number) => ({ - length: height, - offset: height * index, - index -}); const keyExtractor = (item: ISubscription) => item.rid; class RoomsListView extends React.Component { @@ -176,7 +169,7 @@ class RoomsListView extends React.Component (this.scroll = ref); + getScrollRef = (ref: any) => (this.scroll = ref); renderListHeader = () => { const { searching } = this.state; @@ -1012,7 +1005,7 @@ class RoomsListView extends React.Component { console.count(`${this.constructor.name}.render calls`); - const { loading, chats, search, searching } = this.state; + const { chats, search, searching } = this.state; const { showServerDropdown, theme, navigation, displayMode, refreshing } = this.props; const height = displayMode === DisplayMode.Condensed ? ROW_HEIGHT_CONDENSED : ROW_HEIGHT;