From 3b2ee45aad928407e399da78c7fd134bd55cf956 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 8 Feb 2022 14:05:08 -0400 Subject: [PATCH 1/4] migrate getRoomInfo to TS --- app/definitions/IRoom.ts | 1 + app/lib/methods/{getRoomInfo.js => getRoomInfo.ts} | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) rename app/lib/methods/{getRoomInfo.js => getRoomInfo.ts} (80%) diff --git a/app/definitions/IRoom.ts b/app/definitions/IRoom.ts index 503ea4dd728..ca14a4647a0 100644 --- a/app/definitions/IRoom.ts +++ b/app/definitions/IRoom.ts @@ -9,6 +9,7 @@ export interface IRoom { prid: string; t: SubscriptionType; name: string; + fname?: string; teamMain: boolean; alert?: boolean; customFields: string[]; diff --git a/app/lib/methods/getRoomInfo.js b/app/lib/methods/getRoomInfo.ts similarity index 80% rename from app/lib/methods/getRoomInfo.js rename to app/lib/methods/getRoomInfo.ts index 24c061aa047..90ecf2ea661 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) { From 9bcab2fe2f056753c2529a9a5cfc8d6b53d34225 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 8 Feb 2022 23:38:07 -0400 Subject: [PATCH 2/4] update room type --- app/views/SearchMessagesView/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/SearchMessagesView/index.tsx b/app/views/SearchMessagesView/index.tsx index c4cdd6def61..5a035ad501a 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'; const QUERY_SIZE = 50; @@ -83,7 +84,7 @@ class SearchMessagesView extends React.Component | null | undefined; static navigationOptions = ({ navigation, route }: INavigationOption) => { const options: StackNavigationOptions = { From 4ae65fd8875f3b1b59f8455f20bb678f2b7f8cb5 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 9 Feb 2022 13:51:24 -0400 Subject: [PATCH 3/4] update types --- app/lib/methods/getRoomInfo.ts | 2 +- app/views/SearchMessagesView/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/getRoomInfo.ts b/app/lib/methods/getRoomInfo.ts index 90ecf2ea661..b74dbaca195 100644 --- a/app/lib/methods/getRoomInfo.ts +++ b/app/lib/methods/getRoomInfo.ts @@ -2,7 +2,7 @@ import { IRoom } from '../../definitions'; import { getSubscriptionByRoomId } from '../database/services/Subscription'; import RocketChat from '../rocketchat'; -const getRoomInfo = async (rid: string): Promise | null> => { +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 5a035ad501a..b90cb7d7536 100644 --- a/app/views/SearchMessagesView/index.tsx +++ b/app/views/SearchMessagesView/index.tsx @@ -84,7 +84,7 @@ class SearchMessagesView extends React.Component | null | undefined; + private room: Pick | null | undefined; static navigationOptions = ({ navigation, route }: INavigationOption) => { const options: StackNavigationOptions = { From bc292e66228d2cf691f5f546d4d189bd3edff3f0 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 18 Feb 2022 12:40:48 -0400 Subject: [PATCH 4/4] Fix lint error --- app/definitions/IRoom.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/definitions/IRoom.ts b/app/definitions/IRoom.ts index 14919f3ec4c..11130215b56 100644 --- a/app/definitions/IRoom.ts +++ b/app/definitions/IRoom.ts @@ -20,7 +20,6 @@ export interface IRoom { prid: string; t: SubscriptionType; name: string; - fname?: string; teamMain: boolean; alert?: boolean; customFields: string[];