Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Migrate methods/getRoomInfo to TS #3695

Merged
merged 8 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/definitions/IRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface IRoom {
prid: string;
t: SubscriptionType;
name: string;
fname?: string;
teamMain: boolean;
alert?: boolean;
customFields: string[];
Expand Down
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';

const QUERY_SIZE = 50;

Expand Down Expand Up @@ -83,7 +84,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