From 4148ec554c13527587a3079a2dcf0f734fdbefe8 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 26 Apr 2022 17:40:35 -0400 Subject: [PATCH] add: `canPlaceLivechatOnHold` to `Omnichannel`s actions --- app/views/RoomView/RightButtons.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/views/RoomView/RightButtons.tsx b/app/views/RoomView/RightButtons.tsx index 8218971cd..166d4a031 100644 --- a/app/views/RoomView/RightButtons.tsx +++ b/app/views/RoomView/RightButtons.tsx @@ -37,6 +37,7 @@ interface IRightButtonsProps { omnichannelPermissions: { canForwardGuest: boolean; canReturnQueue: boolean; + canPlaceLivechatOnHold: boolean; }; } @@ -195,6 +196,23 @@ class RightButtonsContainer extends Component { + const { navigation, rid } = this.props; + showConfirmationAlert({ + title: i18n.t('Are_you_sure_question_mark'), + message: i18n.t('Would_like_to_place_on_hold'), + confirmationText: i18n.t('Yes'), + onPress: async () => { + try { + await RocketChat.onHoldLivechat(rid); + navigation.navigate('RoomsListView'); + } catch (e: any) { + showErrorAlert(e.data?.error, i18n.t('Oops')); + } + } + }); + }; + closeLivechat = () => { const { dispatch, rid } = this.props; dispatch(closeRoom(rid)); @@ -205,6 +223,14 @@ class RightButtonsContainer extends Component this.placeOnHoldLivechat() + }); + } + if (omnichannelPermissions.canForwardGuest) { options.push({ title: i18n.t('Forward_Chat'),