From bd34344a0c6dc7663f27d5a83f55a352b3eb62fb Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Tue, 7 Dec 2021 16:50:32 -0300 Subject: [PATCH] chore: minor tweaks --- app/views/RoomView/List/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index 0dc2c9759..a1b7f27f1 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -6,6 +6,7 @@ import { dequal } from 'dequal'; import { Value, event } from 'react-native-reanimated'; import { Observable, Subscription } from 'rxjs'; import Model from '@nozbe/watermelondb/Model'; +import { StackNavigationProp } from '@react-navigation/stack'; import database from '../../../lib/database'; import RocketChat from '../../../lib/rocketchat'; @@ -18,6 +19,7 @@ import debounce from '../../../utils/debounce'; import { compareServerVersion, methods } from '../../../lib/utils'; import List from './List'; import NavBottomFAB from './NavBottomFAB'; +import { ChatsStackParamList } from '../../../stacks/types'; const QUERY_SIZE = 50; @@ -43,7 +45,7 @@ interface IRoomListContainerProps { hideSystemMessages: any[]; tunread: []; ignored: []; - navigation: any; // TODO - change this after merge with navigation ts; + navigation: StackNavigationProp; showMessageInMainThread: boolean; serverVersion: string; t?: string; // TODO - verify if this props exist @@ -130,9 +132,9 @@ class ListContainer extends React.Component { componentWillUnmount() { this.unsubscribeMessages(); - if (this.onEndReached && this.onEndReached.stop) { - this.onEndReached.stop(); - } + // if (this.onEndReached && this.onEndReached.stop) { + // this.onEndReached.stop(); + // } if (this.unsubscribeFocus) { this.unsubscribeFocus(); } @@ -176,6 +178,7 @@ class ListContainer extends React.Component { Q.experimentalTake(this.count) ]; if (!showMessageInMainThread) { + // @ts-ignore whereClause.push(Q.or(Q.where('tmid', null), Q.where('tshow', Q.eq(true)))); } this.messagesObservable = db.collections @@ -196,7 +199,7 @@ class ListContainer extends React.Component { * hide system message is enabled */ if (compareServerVersion(serverVersion, '3.16.0', methods.lowerThan) || hideSystemMessages.length) { - messages = messages.filter(m => !m.t || !hideSystemMessages?.includes(m.t)); + messages = messages.filter((m: { t: string }) => !m.t || !hideSystemMessages?.includes(m.t)); } if (this.mounted) {