2019-09-16 20:26:32 +00:00
|
|
|
import { Q } from '@nozbe/watermelondb';
|
2021-02-26 16:01:45 +00:00
|
|
|
import { dequal } from 'dequal';
|
2022-03-02 14:18:01 +00:00
|
|
|
import moment from 'moment';
|
|
|
|
import React from 'react';
|
|
|
|
import { FlatListProps, RefreshControl, ViewToken } from 'react-native';
|
|
|
|
import { event, Value } from 'react-native-reanimated';
|
|
|
|
import { Observable, Subscription } from 'rxjs';
|
2021-05-26 17:24:54 +00:00
|
|
|
|
2022-04-12 16:27:05 +00:00
|
|
|
import { TSupportedThemes } from '../../../theme';
|
2022-04-07 14:10:03 +00:00
|
|
|
import { themes } from '../../../lib/constants';
|
2022-03-02 14:18:01 +00:00
|
|
|
import ActivityIndicator from '../../../containers/ActivityIndicator';
|
|
|
|
import { TAnyMessageModel, TMessageModel, TThreadMessageModel, TThreadModel } from '../../../definitions';
|
2021-05-26 17:24:54 +00:00
|
|
|
import database from '../../../lib/database';
|
2022-04-07 13:13:19 +00:00
|
|
|
import { compareServerVersion } from '../../../lib/methods/helpers/compareServerVersion';
|
2022-03-02 14:18:01 +00:00
|
|
|
import debounce from '../../../utils/debounce';
|
|
|
|
import { animateNextTransition } from '../../../utils/layoutAnimation';
|
2021-05-26 17:24:54 +00:00
|
|
|
import log from '../../../utils/log';
|
|
|
|
import EmptyRoom from '../EmptyRoom';
|
2022-05-02 22:58:23 +00:00
|
|
|
import List, { IListProps, TListRef } from './List';
|
2021-05-26 17:24:54 +00:00
|
|
|
import NavBottomFAB from './NavBottomFAB';
|
2022-04-28 20:37:25 +00:00
|
|
|
import { loadMissedMessages, loadThreadMessages } from '../../../lib/methods';
|
|
|
|
import { Services } from '../../../lib/services';
|
2019-03-27 20:06:57 +00:00
|
|
|
|
2020-07-20 16:44:54 +00:00
|
|
|
const QUERY_SIZE = 50;
|
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
const onScroll = ({ y }: { y: Value<number> }) =>
|
2021-09-13 20:41:05 +00:00
|
|
|
event(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
nativeEvent: {
|
|
|
|
contentOffset: { y }
|
|
|
|
}
|
2021-05-26 17:24:54 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
],
|
|
|
|
{ useNativeDriver: true }
|
|
|
|
);
|
2021-05-26 17:24:54 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
export { IListProps };
|
|
|
|
|
|
|
|
export interface IListContainerProps {
|
|
|
|
renderRow: Function;
|
|
|
|
rid: string;
|
|
|
|
tmid?: string;
|
2022-04-12 16:27:05 +00:00
|
|
|
theme: TSupportedThemes;
|
2022-03-02 14:18:01 +00:00
|
|
|
loading: boolean;
|
2022-05-02 22:58:23 +00:00
|
|
|
listRef: TListRef;
|
2022-03-02 14:18:01 +00:00
|
|
|
hideSystemMessages?: string[];
|
|
|
|
tunread?: string[];
|
|
|
|
ignored?: string[];
|
|
|
|
navigation: any; // TODO: type me
|
|
|
|
showMessageInMainThread: boolean;
|
|
|
|
serverVersion: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IListContainerState {
|
|
|
|
messages: TAnyMessageModel[];
|
|
|
|
refreshing: boolean;
|
|
|
|
highlightedMessage: string | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ListContainer extends React.Component<IListContainerProps, IListContainerState> {
|
|
|
|
private count = 0;
|
|
|
|
private mounted = false;
|
|
|
|
private animated = false;
|
|
|
|
private jumping = false;
|
|
|
|
private y = new Value(0);
|
|
|
|
private onScroll = onScroll({ y: this.y });
|
|
|
|
private unsubscribeFocus: () => void;
|
|
|
|
private viewabilityConfig = {
|
|
|
|
itemVisiblePercentThreshold: 10
|
2019-03-27 20:06:57 +00:00
|
|
|
};
|
2022-06-06 13:23:49 +00:00
|
|
|
private highlightedMessageTimeout: ReturnType<typeof setTimeout> | undefined | false;
|
2022-03-02 14:18:01 +00:00
|
|
|
private thread?: TThreadModel;
|
|
|
|
private messagesObservable?: Observable<TMessageModel[] | TThreadMessageModel[]>;
|
|
|
|
private messagesSubscription?: Subscription;
|
|
|
|
private viewableItems?: ViewToken[];
|
2019-03-27 20:06:57 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
constructor(props: IListContainerProps) {
|
2019-03-27 20:06:57 +00:00
|
|
|
super(props);
|
2021-09-13 20:41:05 +00:00
|
|
|
console.time(`${this.constructor.name} init`);
|
|
|
|
console.time(`${this.constructor.name} mount`);
|
2019-03-27 20:06:57 +00:00
|
|
|
this.state = {
|
2020-02-05 13:27:06 +00:00
|
|
|
messages: [],
|
2021-05-26 17:24:54 +00:00
|
|
|
refreshing: false,
|
|
|
|
highlightedMessage: null
|
2019-03-27 20:06:57 +00:00
|
|
|
};
|
2020-07-20 16:44:54 +00:00
|
|
|
this.query();
|
2020-06-15 14:00:46 +00:00
|
|
|
this.unsubscribeFocus = props.navigation.addListener('focus', () => {
|
2020-12-17 12:56:53 +00:00
|
|
|
this.animated = true;
|
2020-02-17 19:06:18 +00:00
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
console.timeEnd(`${this.constructor.name} init`);
|
2019-03-27 20:06:57 +00:00
|
|
|
}
|
|
|
|
|
2019-04-08 12:35:28 +00:00
|
|
|
componentDidMount() {
|
2019-09-16 20:26:32 +00:00
|
|
|
this.mounted = true;
|
2021-09-13 20:41:05 +00:00
|
|
|
console.timeEnd(`${this.constructor.name} mount`);
|
2019-04-08 12:35:28 +00:00
|
|
|
}
|
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
shouldComponentUpdate(nextProps: IListContainerProps, nextState: IListContainerState) {
|
2021-05-26 17:24:54 +00:00
|
|
|
const { refreshing, highlightedMessage } = this.state;
|
2021-09-13 20:41:05 +00:00
|
|
|
const { hideSystemMessages, theme, tunread, ignored, loading } = this.props;
|
2019-12-04 16:39:53 +00:00
|
|
|
if (theme !== nextProps.theme) {
|
|
|
|
return true;
|
|
|
|
}
|
2021-05-26 17:24:54 +00:00
|
|
|
if (loading !== nextProps.loading) {
|
2019-09-16 20:26:32 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-05-26 17:24:54 +00:00
|
|
|
if (highlightedMessage !== nextState.highlightedMessage) {
|
2019-09-16 20:26:32 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-02-05 13:27:06 +00:00
|
|
|
if (refreshing !== nextState.refreshing) {
|
|
|
|
return true;
|
|
|
|
}
|
2021-02-26 16:01:45 +00:00
|
|
|
if (!dequal(hideSystemMessages, nextProps.hideSystemMessages)) {
|
2020-03-06 14:19:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-02-26 16:01:45 +00:00
|
|
|
if (!dequal(tunread, nextProps.tunread)) {
|
2020-11-12 14:17:32 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-02-26 16:01:45 +00:00
|
|
|
if (!dequal(ignored, nextProps.ignored)) {
|
2020-11-30 20:00:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
2019-09-16 20:26:32 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
componentDidUpdate(prevProps: IListContainerProps) {
|
2020-03-06 14:19:03 +00:00
|
|
|
const { hideSystemMessages } = this.props;
|
2021-02-26 16:01:45 +00:00
|
|
|
if (!dequal(hideSystemMessages, prevProps.hideSystemMessages)) {
|
2020-03-06 14:19:03 +00:00
|
|
|
this.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-27 20:06:57 +00:00
|
|
|
componentWillUnmount() {
|
2019-11-21 19:10:55 +00:00
|
|
|
this.unsubscribeMessages();
|
2020-06-15 14:00:46 +00:00
|
|
|
if (this.unsubscribeFocus) {
|
|
|
|
this.unsubscribeFocus();
|
2020-02-17 19:06:18 +00:00
|
|
|
}
|
2021-05-26 17:24:54 +00:00
|
|
|
this.clearHighlightedMessageTimeout();
|
2021-09-13 20:41:05 +00:00
|
|
|
console.countReset(`${this.constructor.name}.render calls`);
|
2019-03-27 20:06:57 +00:00
|
|
|
}
|
|
|
|
|
2021-05-26 17:24:54 +00:00
|
|
|
clearHighlightedMessageTimeout = () => {
|
|
|
|
if (this.highlightedMessageTimeout) {
|
|
|
|
clearTimeout(this.highlightedMessageTimeout);
|
|
|
|
this.highlightedMessageTimeout = false;
|
2019-03-27 20:06:57 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-07-20 16:44:54 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
query = async () => {
|
2020-07-20 16:44:54 +00:00
|
|
|
this.count += QUERY_SIZE;
|
2021-10-20 16:35:28 +00:00
|
|
|
const { rid, tmid, showMessageInMainThread, serverVersion } = this.props;
|
2020-07-20 16:44:54 +00:00
|
|
|
const db = database.active;
|
|
|
|
|
|
|
|
// handle servers with version < 3.0.0
|
|
|
|
let { hideSystemMessages = [] } = this.props;
|
|
|
|
if (!Array.isArray(hideSystemMessages)) {
|
|
|
|
hideSystemMessages = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tmid) {
|
|
|
|
try {
|
2022-02-01 13:39:09 +00:00
|
|
|
this.thread = await db.get('threads').find(tmid);
|
2020-07-20 16:44:54 +00:00
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
2022-02-01 13:39:09 +00:00
|
|
|
this.messagesObservable = db
|
2020-07-20 16:44:54 +00:00
|
|
|
.get('thread_messages')
|
2021-09-13 20:41:05 +00:00
|
|
|
.query(Q.where('rid', tmid), Q.experimentalSortBy('ts', Q.desc), Q.experimentalSkip(0), Q.experimentalTake(this.count))
|
2020-07-20 16:44:54 +00:00
|
|
|
.observe();
|
|
|
|
} else if (rid) {
|
2020-10-30 17:35:07 +00:00
|
|
|
const whereClause = [
|
|
|
|
Q.where('rid', rid),
|
|
|
|
Q.experimentalSortBy('ts', Q.desc),
|
|
|
|
Q.experimentalSkip(0),
|
|
|
|
Q.experimentalTake(this.count)
|
2022-03-02 14:18:01 +00:00
|
|
|
] as (Q.WhereDescription | Q.Or)[];
|
2020-10-30 17:35:07 +00:00
|
|
|
if (!showMessageInMainThread) {
|
2021-09-13 20:41:05 +00:00
|
|
|
whereClause.push(Q.or(Q.where('tmid', null), Q.where('tshow', Q.eq(true))));
|
2020-10-30 17:35:07 +00:00
|
|
|
}
|
2022-02-01 13:39:09 +00:00
|
|
|
this.messagesObservable = db
|
2020-07-20 16:44:54 +00:00
|
|
|
.get('messages')
|
2020-10-30 17:35:07 +00:00
|
|
|
.query(...whereClause)
|
2020-07-20 16:44:54 +00:00
|
|
|
.observe();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rid) {
|
|
|
|
this.unsubscribeMessages();
|
2022-03-02 14:18:01 +00:00
|
|
|
this.messagesSubscription = this.messagesObservable?.subscribe(messages => {
|
2021-09-13 20:41:05 +00:00
|
|
|
if (tmid && this.thread) {
|
|
|
|
messages = [...messages, this.thread];
|
|
|
|
}
|
2021-10-20 16:35:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Since 3.16.0 server version, the backend don't response with messages if
|
|
|
|
* hide system message is enabled
|
|
|
|
*/
|
2022-02-07 18:44:04 +00:00
|
|
|
if (compareServerVersion(serverVersion, 'lowerThan', '3.16.0') || hideSystemMessages.length) {
|
2021-10-20 16:35:28 +00:00
|
|
|
messages = messages.filter(m => !m.t || !hideSystemMessages?.includes(m.t));
|
|
|
|
}
|
2020-07-20 16:44:54 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
if (this.mounted) {
|
|
|
|
this.setState({ messages }, () => this.update());
|
|
|
|
} else {
|
2022-03-02 14:18:01 +00:00
|
|
|
// @ts-ignore
|
2021-09-13 20:41:05 +00:00
|
|
|
this.state.messages = messages;
|
|
|
|
}
|
|
|
|
// TODO: move it away from here
|
|
|
|
this.readThreads();
|
|
|
|
});
|
2020-07-20 16:44:54 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-07-20 16:44:54 +00:00
|
|
|
|
|
|
|
reload = () => {
|
|
|
|
this.count = 0;
|
|
|
|
this.query();
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2020-07-20 16:44:54 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
readThreads = debounce(async () => {
|
2020-07-20 16:44:54 +00:00
|
|
|
const { tmid } = this.props;
|
|
|
|
|
|
|
|
if (tmid) {
|
|
|
|
try {
|
2022-04-28 20:37:25 +00:00
|
|
|
await Services.readThreads(tmid);
|
2020-07-20 16:44:54 +00:00
|
|
|
} catch {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
}, 300);
|
2020-06-09 20:09:18 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
onEndReached = () => this.query();
|
2020-06-09 20:09:18 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
onRefresh = () =>
|
|
|
|
this.setState({ refreshing: true }, async () => {
|
|
|
|
const { messages } = this.state;
|
|
|
|
const { rid, tmid } = this.props;
|
2020-02-05 13:27:06 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
if (messages.length) {
|
|
|
|
try {
|
|
|
|
if (tmid) {
|
2022-04-28 20:37:25 +00:00
|
|
|
await loadThreadMessages({ tmid, rid });
|
2021-09-13 20:41:05 +00:00
|
|
|
} else {
|
2022-04-28 20:37:25 +00:00
|
|
|
await loadMissedMessages({ rid, lastOpen: moment().subtract(7, 'days').toDate() });
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
log(e);
|
2020-02-05 13:27:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
this.setState({ refreshing: false });
|
|
|
|
});
|
2020-02-05 13:27:06 +00:00
|
|
|
|
2019-11-07 19:53:39 +00:00
|
|
|
update = () => {
|
2020-12-17 12:56:53 +00:00
|
|
|
if (this.animated) {
|
2020-02-17 19:06:18 +00:00
|
|
|
animateNextTransition();
|
|
|
|
}
|
2019-11-07 19:53:39 +00:00
|
|
|
this.forceUpdate();
|
|
|
|
};
|
|
|
|
|
2019-11-21 19:10:55 +00:00
|
|
|
unsubscribeMessages = () => {
|
|
|
|
if (this.messagesSubscription && this.messagesSubscription.unsubscribe) {
|
|
|
|
this.messagesSubscription.unsubscribe();
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2019-11-21 19:10:55 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
getLastMessage = (): TMessageModel | TThreadMessageModel | null => {
|
2019-11-25 20:01:17 +00:00
|
|
|
const { messages } = this.state;
|
|
|
|
if (messages.length > 0) {
|
|
|
|
return messages[0];
|
|
|
|
}
|
|
|
|
return null;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2019-11-25 20:01:17 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
handleScrollToIndexFailed: FlatListProps<any>['onScrollToIndexFailed'] = params => {
|
2021-05-26 17:24:54 +00:00
|
|
|
const { listRef } = this.props;
|
2022-05-02 22:58:23 +00:00
|
|
|
listRef.current?.getNode().scrollToIndex({ index: params.highestMeasuredFrameIndex, animated: false });
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-05-26 17:24:54 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
jumpToMessage = (messageId: string) =>
|
|
|
|
new Promise<void>(async resolve => {
|
2021-09-13 20:41:05 +00:00
|
|
|
this.jumping = true;
|
|
|
|
const { messages } = this.state;
|
|
|
|
const { listRef } = this.props;
|
|
|
|
const index = messages.findIndex(item => item.id === messageId);
|
|
|
|
if (index > -1) {
|
2022-05-02 22:58:23 +00:00
|
|
|
listRef.current?.getNode().scrollToIndex({ index, viewPosition: 0.5, viewOffset: 100 });
|
2021-09-13 20:41:05 +00:00
|
|
|
await new Promise(res => setTimeout(res, 300));
|
2022-03-02 14:18:01 +00:00
|
|
|
if (!this.viewableItems?.map(vi => vi.key).includes(messageId)) {
|
2021-09-13 20:41:05 +00:00
|
|
|
if (!this.jumping) {
|
|
|
|
return resolve();
|
|
|
|
}
|
|
|
|
await setTimeout(() => resolve(this.jumpToMessage(messageId)), 300);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.setState({ highlightedMessage: messageId });
|
|
|
|
this.clearHighlightedMessageTimeout();
|
|
|
|
this.highlightedMessageTimeout = setTimeout(() => {
|
|
|
|
this.setState({ highlightedMessage: null });
|
|
|
|
}, 10000);
|
|
|
|
await setTimeout(() => resolve(), 300);
|
|
|
|
} else {
|
2022-05-02 22:58:23 +00:00
|
|
|
listRef.current?.getNode().scrollToIndex({ index: messages.length - 1, animated: false });
|
2021-05-26 17:24:54 +00:00
|
|
|
if (!this.jumping) {
|
|
|
|
return resolve();
|
|
|
|
}
|
|
|
|
await setTimeout(() => resolve(this.jumpToMessage(messageId)), 300);
|
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
});
|
2021-05-26 17:24:54 +00:00
|
|
|
|
|
|
|
// this.jumping is checked in between operations to make sure we're not stuck
|
|
|
|
cancelJumpToMessage = () => {
|
|
|
|
this.jumping = false;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-05-26 17:24:54 +00:00
|
|
|
|
|
|
|
jumpToBottom = () => {
|
|
|
|
const { listRef } = this.props;
|
2022-05-02 22:58:23 +00:00
|
|
|
listRef.current?.getNode().scrollToOffset({ offset: -100 });
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-05-26 17:24:54 +00:00
|
|
|
|
2019-03-27 20:06:57 +00:00
|
|
|
renderFooter = () => {
|
2022-03-18 02:37:10 +00:00
|
|
|
const { rid, loading } = this.props;
|
2019-11-25 20:01:17 +00:00
|
|
|
if (loading && rid) {
|
2022-03-18 02:37:10 +00:00
|
|
|
return <ActivityIndicator />;
|
2019-03-27 20:06:57 +00:00
|
|
|
}
|
|
|
|
return null;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2019-03-27 20:06:57 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
renderItem: FlatListProps<any>['renderItem'] = ({ item, index }) => {
|
2021-05-26 17:24:54 +00:00
|
|
|
const { messages, highlightedMessage } = this.state;
|
2019-04-17 17:01:03 +00:00
|
|
|
const { renderRow } = this.props;
|
2021-05-26 17:24:54 +00:00
|
|
|
return renderRow(item, messages[index + 1], highlightedMessage);
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2021-05-26 17:24:54 +00:00
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
onViewableItemsChanged: FlatListProps<any>['onViewableItemsChanged'] = ({ viewableItems }) => {
|
2021-05-26 17:24:54 +00:00
|
|
|
this.viewableItems = viewableItems;
|
2021-09-13 20:41:05 +00:00
|
|
|
};
|
2019-04-17 17:01:03 +00:00
|
|
|
|
2019-03-27 20:06:57 +00:00
|
|
|
render() {
|
2021-09-13 20:41:05 +00:00
|
|
|
console.count(`${this.constructor.name}.render calls`);
|
2021-05-26 17:24:54 +00:00
|
|
|
const { rid, tmid, listRef } = this.props;
|
2020-02-05 13:27:06 +00:00
|
|
|
const { messages, refreshing } = this.state;
|
2019-12-04 16:39:53 +00:00
|
|
|
const { theme } = this.props;
|
2019-03-27 20:06:57 +00:00
|
|
|
return (
|
2019-09-16 20:26:32 +00:00
|
|
|
<>
|
2022-03-02 14:18:01 +00:00
|
|
|
<EmptyRoom rid={rid} length={messages.length} mounted={this.mounted} />
|
2021-05-26 17:24:54 +00:00
|
|
|
<List
|
|
|
|
onScroll={this.onScroll}
|
|
|
|
scrollEventThrottle={16}
|
|
|
|
listRef={listRef}
|
2019-05-03 13:33:38 +00:00
|
|
|
data={messages}
|
2019-04-17 17:01:03 +00:00
|
|
|
renderItem={this.renderItem}
|
2019-03-27 20:06:57 +00:00
|
|
|
onEndReached={this.onEndReached}
|
|
|
|
ListFooterComponent={this.renderFooter}
|
2021-05-26 17:24:54 +00:00
|
|
|
onScrollToIndexFailed={this.handleScrollToIndexFailed}
|
|
|
|
onViewableItemsChanged={this.onViewableItemsChanged}
|
|
|
|
viewabilityConfig={this.viewabilityConfig}
|
2021-09-13 20:41:05 +00:00
|
|
|
refreshControl={
|
|
|
|
<RefreshControl refreshing={refreshing} onRefresh={this.onRefresh} tintColor={themes[theme].auxiliaryText} />
|
|
|
|
}
|
2019-03-27 20:06:57 +00:00
|
|
|
/>
|
2021-05-26 17:24:54 +00:00
|
|
|
<NavBottomFAB y={this.y} onPress={this.jumpToBottom} isThread={!!tmid} />
|
2019-09-16 20:26:32 +00:00
|
|
|
</>
|
2019-03-27 20:06:57 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-12-04 16:39:53 +00:00
|
|
|
|
2022-05-02 22:58:23 +00:00
|
|
|
export type ListContainerType = ListContainer;
|
|
|
|
|
2021-05-26 17:24:54 +00:00
|
|
|
export default ListContainer;
|