chore: minor tweaks

This commit is contained in:
AlexAlexandre 2021-12-07 15:13:30 -03:00
parent 244c2a05a9
commit ba2b9e862b
3 changed files with 14 additions and 9 deletions

View File

@ -26,4 +26,5 @@ export interface IRoom extends IRocketChatRecord {
observe?: Function;
usedCannedResponse?: string;
bannerClosed?: boolean;
lastOpen?: Date;
}

View File

@ -138,17 +138,21 @@ interface IRoomViewProps {
interface IRoomItem {
id?: string;
tmid?: string;
tmsg?: string;
t?: any;
e2e?: string;
tlm?: string;
rid?: string;
ts?: Date;
status?: any;
u?: { _id: string };
}
interface INavToThread {
id?: string;
tmsg?: string;
t?: any;
e2e?: string;
tmid?: string;
tlm?: string;
}
class RoomView extends React.Component<IRoomViewProps, any> {
private rid: string;
private t: RoomType;
@ -927,7 +931,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
}
};
navToThread = async (item: IRoomItem) => {
navToThread = async (item: INavToThread) => {
const { roomUserId } = this.state;
const { navigation } = this.props;
@ -965,7 +969,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
}
};
navToRoom = async (message: IRoomItem) => {
navToRoom = async (message: { rid: string; id: string }) => {
const { navigation, isMasterDetail } = this.props;
const roomInfo: any = await getRoomInfo(message.rid);
return goRoom({

View File

@ -1,7 +1,7 @@
import RocketChat from '../../../lib/rocketchat';
import { IRoom } from '../../../definitions/IRoom';
// TODO - after merge navigation ts, change the room and the promisse return
const getMessages = (room: any): Promise<any> => {
const getMessages = (room: IRoom): Promise<void> => {
if (room.lastOpen) {
return RocketChat.loadMissedMessages(room);
}