Skip to content

Commit

Permalink
Chore: Migrate methods/getRoomInfo to TS (RocketChat#3695)
Browse files Browse the repository at this point in the history
* migrate getRoomInfo to TS

* update room type

* update types

* Fix lint error
  • Loading branch information
gerzonc authored Feb 19, 2022
1 parent 12cdd1b commit 1b4709f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion app/views/SearchMessagesView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 1b4709f

Please sign in to comment.