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 all 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
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