chore: minor tweaks
This commit is contained in:
parent
ba2b9e862b
commit
2493cf3f59
|
@ -21,7 +21,7 @@ const styles = StyleSheet.create({
|
|||
});
|
||||
|
||||
interface IRoomLoadMoreProps {
|
||||
load(): Promise<unknown>;
|
||||
load(): any;
|
||||
type?: string;
|
||||
runOnRender?: boolean;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue