From 3c53d48a3eda43468aa19ac6bc72b0321b2d2f89 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Mon, 18 Apr 2022 16:35:50 -0300 Subject: [PATCH] [FIX] Omnichannel chat is broken the first time is taken (#4037) * [FIX] Omnichannel chat is broken the first time is taken * refactor how to get a room from db --- app/views/RoomActionsView/index.tsx | 36 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index b3aed44d..45d8b0f5 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -16,7 +16,15 @@ import RoomTypeIcon from '../../containers/RoomTypeIcon'; import SafeAreaView from '../../containers/SafeAreaView'; import Status from '../../containers/Status'; import StatusBar from '../../containers/StatusBar'; -import { IApplicationState, IBaseScreen, IRoom, ISubscription, IUser, TSubscriptionModel } from '../../definitions'; +import { + IApplicationState, + IBaseScreen, + IRoom, + ISubscription, + IUser, + SubscriptionType, + TSubscriptionModel +} from '../../definitions'; import { withDimensions } from '../../dimensions'; import I18n from '../../i18n'; import database from '../../lib/database'; @@ -33,6 +41,7 @@ import styles from './styles'; import { ERoomType } from '../../definitions/ERoomType'; import { E2E_ROOM_TYPES, SWITCH_TRACK_COLOR, themes } from '../../lib/constants'; import { compareServerVersion } from '../../lib/methods/helpers/compareServerVersion'; +import { getSubscriptionByRoomId } from '../../lib/database/services/Subscription'; interface IRoomActionsViewProps extends IBaseScreen { userId: string; @@ -139,15 +148,24 @@ class RoomActionsView extends React.Component