Skip to content

Commit

Permalink
intrude/listen. Update store on call close (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 authored May 24, 2024
1 parent db596d2 commit 4490df4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/CallView/DisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ const DisplayName: FC<DisplayNameProps> = () => {
}`}
ref={nameText}
>
{intrudeListenStatus?.isIntrudeExtension !== ''
{intrudeListenStatus?.isIntrudeExtension !== '' &&
intrudeListenStatus?.isIntrudeExtension !== undefined
? `${t('Common.Intrude')}` + '-' + intrudeListenStatus?.isIntrudeExtension
: '-'}
: `${t('Common.Intrude')}`}
</div>
<div className='pi-w-6 pi-absolute pi-right-0 pi-top-0 pi-h-full pi-bg-gradient-to-r pi-from-transparent dark:pi-to-gray-950 pi-to-gray-50'></div>
</NameMotion>
Expand All @@ -60,9 +61,10 @@ const DisplayName: FC<DisplayNameProps> = () => {
}`}
ref={nameText}
>
{intrudeListenStatus?.isListenExtension !== ''
{intrudeListenStatus?.isListenExtension !== '' &&
intrudeListenStatus?.isListenExtension !== undefined
? `${t('Common.Listen')}` + '-' + intrudeListenStatus?.isListenExtension
: '-'}
: `${t('Common.Listen')}`}
</div>
<div className='pi-w-6 pi-absolute pi-right-0 pi-top-0 pi-h-full pi-bg-gradient-to-r pi-from-transparent dark:pi-to-gray-950 pi-to-gray-50'></div>
</NameMotion>
Expand Down
11 changes: 10 additions & 1 deletion src/components/Hangup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ const Hangup: FC<HangupProps> = ({ clickCallback, isDestination, description })
} else {
hangupCurrentCall()
}

// Delay the dispatch actions
setTimeout(() => {
dispatch.listen.setUpdateIntrudeStatus(false, '')
dispatch.listen.setUpdateListenStatus(false, '')
}, 2000)

// Show confirmation message when a call is transferred
if (transferring) {
setTimeout(() => {
Expand Down Expand Up @@ -64,7 +71,9 @@ const Hangup: FC<HangupProps> = ({ clickCallback, isDestination, description })
onClick={() => handleHangup()}
variant='red'
className='pi-gap-4 pi-font-medium pi-text-base pi-transition pi-min-w-12 pi-w-full'
data-tooltip-id={description && transferring ? 'tooltip-top-transfer' : 'tooltip-left-transfer'}
data-tooltip-id={
description && transferring ? 'tooltip-top-transfer' : 'tooltip-left-transfer'
}
data-tooltip-content={
description && transferring ? description : `${t('Tooltip.Hangup')}`
}
Expand Down

0 comments on commit 4490df4

Please sign in to comment.