Disable "Call Again" if already on a call

This commit is contained in:
Evan Hahn 2022-02-11 12:21:45 -06:00 committed by GitHub
parent ae3b12bea8
commit eed3e8e316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 6 deletions

View file

@ -114,6 +114,7 @@ function renderCallingNotificationButton(
props: Readonly<PropsType>
): ReactNode {
const {
activeCallConversationId,
conversationId,
i18n,
nextItem,
@ -135,16 +136,23 @@ function renderCallingNotificationButton(
buttonText = wasIncoming
? i18n('calling__call-back')
: i18n('calling__call-again');
onClick = () => {
startCallingLobby({ conversationId, isVideoCall: wasVideoCall });
};
if (activeCallConversationId) {
disabledTooltipText = i18n(
'calling__call-notification__button__in-another-call-tooltip'
);
onClick = noop;
} else {
onClick = () => {
startCallingLobby({ conversationId, isVideoCall: wasVideoCall });
};
}
break;
}
case CallMode.Group: {
if (props.ended) {
return null;
}
const { activeCallConversationId, deviceCount, maxDevices } = props;
const { deviceCount, maxDevices } = props;
if (activeCallConversationId) {
if (activeCallConversationId === conversationId) {
buttonText = i18n('calling__return');