diff --git a/app/definitions/IRoom.ts b/app/definitions/IRoom.ts index cb0106a59..40f9b290f 100644 --- a/app/definitions/IRoom.ts +++ b/app/definitions/IRoom.ts @@ -210,6 +210,8 @@ export interface IServerRoom extends IRocketChatRecord { departmentId?: string; livechatData?: any; tags?: string[]; + + isLastOwner?: boolean; } export interface IRoomNotifications { diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index 2e349bc34..dc1fdac74 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable complexity */ import { Q } from '@nozbe/watermelondb'; import { StackNavigationOptions } from '@react-navigation/stack'; import isEmpty from 'lodash/isEmpty'; @@ -45,6 +46,10 @@ import { import { Services } from '../../lib/services'; import { getSubscriptionByRoomId } from '../../lib/database/services/Subscription'; +interface IOnPressTouch { + (item: { route?: T; params?: ChatsStackParamList[T]; event?: Function }): void; +} + interface IRoomActionsViewProps extends IBaseScreen { userId: string; jitsiEnabled: boolean; @@ -176,7 +181,7 @@ class RoomActionsView extends React.Component { + onPressTouchable: IOnPressTouch = (item: { + route?: keyof ChatsStackParamList; + params?: ChatsStackParamList[keyof ChatsStackParamList]; + event?: Function; + }) => { const { route, event, params } = item; if (route) { /** @@ -640,7 +648,7 @@ class RoomActionsView extends React.Component ({ + const teamChannels = result.rooms.map(r => ({ rid: r._id, name: r.name, teamId: r.teamId, @@ -1090,7 +1098,6 @@ class RoomActionsView extends React.Component this.onPressTouchable({ route: 'CannedResponsesListView', params: { rid, room } })} + onPress={() => this.onPressTouchable({ route: 'CannedResponsesListView', params: { rid } })} left={() => } showActionIndicator />