chore: minor tweaks
This commit is contained in:
parent
ba2b9e862b
commit
2493cf3f59
|
@ -21,7 +21,7 @@ const styles = StyleSheet.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
interface IRoomLoadMoreProps {
|
interface IRoomLoadMoreProps {
|
||||||
load(): Promise<unknown>;
|
load(): any;
|
||||||
type?: string;
|
type?: string;
|
||||||
runOnRender?: boolean;
|
runOnRender?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,12 +136,18 @@ interface IRoomViewProps {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IRoomItem {
|
export interface IRoomItem {
|
||||||
id?: string;
|
id?: string;
|
||||||
t?: any;
|
t: any;
|
||||||
ts?: Date;
|
rid: string;
|
||||||
|
tmid?: string;
|
||||||
|
ts: Date;
|
||||||
status?: any;
|
status?: any;
|
||||||
u?: { _id: string };
|
u?: { _id: string };
|
||||||
|
loaderItem: {
|
||||||
|
t: string;
|
||||||
|
ts: Date;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
interface INavToThread {
|
interface INavToThread {
|
||||||
|
@ -1043,7 +1049,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
|
||||||
return room?.ignored?.includes?.(message?.u?._id) ?? false;
|
return room?.ignored?.includes?.(message?.u?._id) ?? false;
|
||||||
};
|
};
|
||||||
|
|
||||||
onLoadMoreMessages = (loaderItem: any): any =>
|
onLoadMoreMessages = (loaderItem: IRoomItem) =>
|
||||||
RoomServices.getMoreMessages({
|
RoomServices.getMoreMessages({
|
||||||
rid: this.rid,
|
rid: this.rid,
|
||||||
tmid: this.tmid,
|
tmid: this.tmid,
|
||||||
|
|
|
@ -5,8 +5,17 @@ import {
|
||||||
} from '../../../constants/messageTypeLoad';
|
} from '../../../constants/messageTypeLoad';
|
||||||
import RocketChat from '../../../lib/rocketchat';
|
import RocketChat from '../../../lib/rocketchat';
|
||||||
|
|
||||||
// TODO - after merge navigation ts
|
interface IGetMoreMessages {
|
||||||
const getMoreMessages = ({ rid, t, tmid, loaderItem }: any) => {
|
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)) {
|
if ([MESSAGE_TYPE_LOAD_MORE, MESSAGE_TYPE_LOAD_PREVIOUS_CHUNK].includes(loaderItem.t)) {
|
||||||
return RocketChat.loadMessagesForRoom({
|
return RocketChat.loadMessagesForRoom({
|
||||||
rid,
|
rid,
|
||||||
|
|
Loading…
Reference in New Issue