Chore: Migrate methods/getRoomInfo to TS (#3695)
* migrate getRoomInfo to TS * update room type * update types * Fix lint error
This commit is contained in:
parent
4e24b7cd82
commit
1cfa45eeec
|
@ -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<Pick<IRoom, 'rid' | 'name' | 'fname' | 't'> | null> => {
|
||||
let result;
|
||||
result = await getSubscriptionByRoomId(rid);
|
||||
if (result) {
|
|
@ -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<ISearchMessagesViewProps, ISear
|
|||
|
||||
private encrypted: boolean | undefined;
|
||||
|
||||
private room: { rid: any; name: any; fname: any; t: any } | null | undefined;
|
||||
private room: Pick<IRoom, 'rid' | 'name' | 'fname' | 't'> | null | undefined;
|
||||
|
||||
static navigationOptions = ({ navigation, route }: INavigationOption) => {
|
||||
const options: StackNavigationOptions = {
|
||||
|
|
Loading…
Reference in New Issue