chore: minor tweaks

This commit is contained in:
AlexAlexandre 2021-12-07 15:37:34 -03:00
parent ba2b9e862b
commit 2493cf3f59
3 changed files with 22 additions and 7 deletions

View File

@ -21,7 +21,7 @@ const styles = StyleSheet.create({
});
interface IRoomLoadMoreProps {
load(): Promise<unknown>;
load(): any;
type?: string;
runOnRender?: boolean;
}

View File

@ -136,12 +136,18 @@ interface IRoomViewProps {
};
}
interface IRoomItem {
export interface IRoomItem {
id?: string;
t?: any;
ts?: Date;
t: any;
rid: string;
tmid?: string;
ts: Date;
status?: any;
u?: { _id: string };
loaderItem: {
t: string;
ts: Date;
};
}
interface INavToThread {
@ -1043,7 +1049,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
return room?.ignored?.includes?.(message?.u?._id) ?? false;
};
onLoadMoreMessages = (loaderItem: any): any =>
onLoadMoreMessages = (loaderItem: IRoomItem) =>
RoomServices.getMoreMessages({
rid: this.rid,
tmid: this.tmid,

View File

@ -5,8 +5,17 @@ import {
} from '../../../constants/messageTypeLoad';
import RocketChat from '../../../lib/rocketchat';
// TODO - after merge navigation ts
const getMoreMessages = ({ rid, t, tmid, loaderItem }: any) => {
interface IGetMoreMessages {
rid: string;
t?: string;
tmid?: string;
loaderItem: {
t: string;
ts: Date;
};
}
const getMoreMessages = ({ rid, t, tmid, loaderItem }: IGetMoreMessages) => {
if ([MESSAGE_TYPE_LOAD_MORE, MESSAGE_TYPE_LOAD_PREVIOUS_CHUNK].includes(loaderItem.t)) {
return RocketChat.loadMessagesForRoom({
rid,