Skip to content

Commit

Permalink
TS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed May 13, 2021
1 parent 6488c5a commit 36e8eba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/threads/client/components/ThreadComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ThreadComponent: FC<{
}, [dispatchToastMessage, followMessage, unfollowMessage, mid]);

const handleClose = useCallback(() => {
channelRoute.push(room.t === 'd' ? { rid: room._id } : { name: room.name });
channelRoute.push(room.t === 'd' ? { rid: room._id } : { name: room.name || room._id });
}, [channelRoute, room._id, room.t, room.name]);

const [viewData, setViewData] = useState(() => ({
Expand Down
6 changes: 3 additions & 3 deletions client/components/Omnichannel/modals/TranscriptModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Field, Button, TextInput, Icon, ButtonGroup, Modal } from '@rocket.chat
import { useAutoFocus } from '@rocket.chat/fuselage-hooks';
import React, { FC, useCallback, useEffect, useState, useMemo } from 'react';

import { IRoom } from '../../../../definition/IRoom';
import { IOmnichannelRoom } from '../../../../definition/IRoom';
import { useTranslation } from '../../../contexts/TranslationContext';
import { useComponentDidUpdate } from '../../../hooks/useComponentDidUpdate';
import { useForm } from '../../../hooks/useForm';

type TranscriptModalProps = {
email: string;
room?: IRoom;
room: IOmnichannelRoom;
onRequest: (email: string, subject: string) => void;
onSend?: (email: string, subject: string, token: string) => void;
onCancel: () => void;
Expand Down Expand Up @@ -38,7 +38,7 @@ const TranscriptModal: FC<TranscriptModalProps> = ({
const { handleEmail, handleSubject } = handlers;
const [emailError, setEmailError] = useState('');
const [subjectError, setSubjectError] = useState('');
const { transcriptRequest } = (room as unknown) as IRoom;
const { transcriptRequest } = room;
const roomOpen = room && room.open;
const token = room?.v?.token;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import toastr from 'toastr';

import { RoomManager } from '../../../../../../app/ui-utils/client';
import { handleError } from '../../../../../../app/utils/client';
import { IRoom } from '../../../../../../definition/IRoom';
import { IOmnichannelRoom } from '../../../../../../definition/IRoom';
import PlaceChatOnHoldModal from '../../../../../../ee/app/livechat-enterprise/client/components/modals/PlaceChatOnHoldModal';
import Header from '../../../../../components/Header';
import CloseChatModal from '../../../../../components/Omnichannel/modals/CloseChatModal';
Expand All @@ -35,7 +35,7 @@ import { QuickActionsActionConfig, QuickActionsEnum } from '../../../lib/QuickAc
import { QuickActionsContext } from '../../../lib/QuickActions/QuickActionsContext';

type QuickActionsProps = {
room: IRoom;
room: IOmnichannelRoom;
className?: ComponentProps<typeof Box>['className'];
};

Expand All @@ -49,7 +49,7 @@ const QuickActions: FC<QuickActionsProps> = ({ room, className }) => {
);
const visibleActions = isMobile ? [] : actions.slice(0, 6);
const [email, setEmail] = useState('');
const visitorRoomId = room.v?._id;
const visitorRoomId = room.v._id;
const rid = room._id;
const uid = useUserId();

Expand Down Expand Up @@ -215,9 +215,9 @@ const QuickActions: FC<QuickActionsProps> = ({ room, className }) => {
break;
case QuickActionsEnum.CloseChat:
setModal(
room?.departmentId ? (
room.departmentId ? (
<CloseChatModalData
departmentId={room?.departmentId}
departmentId={room.departmentId}
onConfirm={handleClose}
onCancel={closeModal}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/views/room/Header/RoomHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FC } from 'react';

import { IRoom } from '../../../../definition/IRoom';
import { IOmnichannelRoom } from '../../../../definition/IRoom';
import Header from '../../../components/Header';
import MarkdownText from '../../../components/MarkdownText';
import RoomAvatar from '../../../components/avatar/RoomAvatar';
Expand All @@ -13,7 +13,7 @@ import Favorite from './icons/Favorite';
import Translate from './icons/Translate';

export type RoomHeaderProps = {
room: IRoom;
room: IOmnichannelRoom;
topic?: string;
slots: {
start?: unknown;
Expand Down

0 comments on commit 36e8eba

Please sign in to comment.