From 1cfa45eeec7aab16b0c5a58f685c3dd814899ba2 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 18 Feb 2022 22:09:05 -0400 Subject: [PATCH] Chore: Migrate methods/getRoomInfo to TS (#3695) * migrate getRoomInfo to TS * update room type * update types * Fix lint error --- app/lib/methods/{getRoomInfo.js => getRoomInfo.ts} | 3 ++- app/views/SearchMessagesView/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) rename app/lib/methods/{getRoomInfo.js => getRoomInfo.ts} (77%) diff --git a/app/lib/methods/getRoomInfo.js b/app/lib/methods/getRoomInfo.ts similarity index 77% rename from app/lib/methods/getRoomInfo.js rename to app/lib/methods/getRoomInfo.ts index 24c061aa..b74dbaca 100644 --- a/app/lib/methods/getRoomInfo.js +++ b/app/lib/methods/getRoomInfo.ts @@ -1,7 +1,8 @@ +import { IRoom } from '../../definitions'; import { getSubscriptionByRoomId } from '../database/services/Subscription'; import RocketChat from '../rocketchat'; -const getRoomInfo = async rid => { +const getRoomInfo = async (rid: string): Promise | null> => { let result; result = await getSubscriptionByRoomId(rid); if (result) { diff --git a/app/views/SearchMessagesView/index.tsx b/app/views/SearchMessagesView/index.tsx index b1b8c1ed..2da0c7a6 100644 --- a/app/views/SearchMessagesView/index.tsx +++ b/app/views/SearchMessagesView/index.tsx @@ -32,6 +32,7 @@ import { isIOS } from '../../utils/deviceInfo'; import { compareServerVersion } from '../../lib/utils'; import styles from './styles'; import { InsideStackParamList, ChatsStackParamList } from '../../stacks/types'; +import { IRoom } from '../../definitions'; import { IEmoji } from '../../definitions/IEmoji'; const QUERY_SIZE = 50; @@ -81,7 +82,7 @@ class SearchMessagesView extends React.Component | null | undefined; static navigationOptions = ({ navigation, route }: INavigationOption) => { const options: StackNavigationOptions = {