diff --git a/app/stacks/types.ts b/app/stacks/types.ts index 44732412e..15902f18a 100644 --- a/app/stacks/types.ts +++ b/app/stacks/types.ts @@ -42,7 +42,11 @@ export type ChatsStackParamList = { rid: string; t: SubscriptionType; joined: boolean; - omnichannelPermissions: boolean[]; + omnichannelPermissions: { + canForwardGuest: boolean; + canReturnQueue: boolean; + canViewCannedResponse: boolean; + }; }; SelectListView: { data?: IRoom[]; diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index cdf252908..5ff1c8c4e 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -61,7 +61,6 @@ interface IRoomActionsViewProps extends IBaseScreen; private subscription?: Subscription; @@ -967,7 +970,7 @@ class RoomActionsView extends React.Component - {this.omnichannelPermissions[0] ? ( + {this.omnichannelPermissions.canForwardGuest ? ( <> ) : null} - {this.omnichannelPermissions[1] ? ( + {this.omnichannelPermissions.canReturnQueue ? ( <> ) : null} - {['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions[2] ? ( + {['l'].includes(t) && !this.isOmnichannelPreview && this.omnichannelPermissions.canViewCannedResponse ? ( <> ; - omnichannelPermissions: boolean[]; // TODO: Update to proper type + omnichannelPermissions: { + canForwardGuest: boolean; + canReturnQueue: boolean; + }; } interface IRigthButtonsState { @@ -194,7 +197,6 @@ class RightButtonsContainer extends Component { const { dispatch, rid } = this.props; - dispatch(closeRoom(rid)); }; @@ -203,7 +205,7 @@ class RightButtonsContainer extends Component { numIconsRight = 3; } const headerTitlePosition = getHeaderTitlePosition({ insets, numIconsRight }); - const omnichannelPermissions = [canForwardGuest, canReturnQueue]; + const omnichannelPermissions = { canForwardGuest, canReturnQueue }; navigation.setOptions({ headerShown: true, headerTitleAlign: 'left', @@ -593,7 +593,7 @@ class RoomView extends React.Component { member, showCloseModal: !!screen, joined, - omnichannelPermissions: [canForwardGuest, canReturnQueue, canViewCannedResponse] + omnichannelPermissions: { canForwardGuest, canReturnQueue, canViewCannedResponse } } }); } else if (this.rid && this.t) { @@ -603,7 +603,7 @@ class RoomView extends React.Component { room: room as TSubscriptionModel, member, joined, - omnichannelPermissions: [canForwardGuest, canReturnQueue, canViewCannedResponse] + omnichannelPermissions: { canForwardGuest, canReturnQueue, canViewCannedResponse } }); } };