Update call strings
This commit is contained in:
parent
a634792be7
commit
26140ee3d6
7 changed files with 289 additions and 53 deletions
|
@ -35,6 +35,8 @@ import {
|
|||
useKeyboardShortcutsConditionally,
|
||||
useOpenContextMenu,
|
||||
} from '../../hooks/useKeyboardShortcuts';
|
||||
import { MINUTE } from '../../util/durations';
|
||||
import { isMoreRecentThan } from '../../util/timestamp';
|
||||
|
||||
export type PropsActionsType = {
|
||||
onOutgoingAudioCallInConversation: (conversationId: string) => void;
|
||||
|
@ -105,7 +107,9 @@ export const CallingNotification: React.FC<PropsType> = React.memo(
|
|||
icon={icon}
|
||||
kind={
|
||||
status === DirectCallStatus.Missed ||
|
||||
status === GroupCallStatus.Missed
|
||||
status === GroupCallStatus.Missed ||
|
||||
status === DirectCallStatus.Declined ||
|
||||
status === GroupCallStatus.Declined
|
||||
? SystemMessageKind.Danger
|
||||
: SystemMessageKind.Normal
|
||||
}
|
||||
|
@ -188,9 +192,21 @@ function renderCallingNotificationButton(
|
|||
}
|
||||
case CallMode.Group: {
|
||||
if (props.groupCallEnded) {
|
||||
return null;
|
||||
}
|
||||
if (props.activeConversationId != null) {
|
||||
const { direction, status, timestamp } = props.callHistory;
|
||||
if (
|
||||
(direction === CallDirection.Incoming &&
|
||||
(status === GroupCallStatus.Declined ||
|
||||
status === GroupCallStatus.Missed)) ||
|
||||
isMoreRecentThan(timestamp, 5 * MINUTE)
|
||||
) {
|
||||
buttonText = i18n('icu:calling__call-back');
|
||||
onClick = () => {
|
||||
onOutgoingVideoCallInConversation(conversationId);
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else if (props.activeConversationId != null) {
|
||||
if (props.activeConversationId === conversationId) {
|
||||
buttonText = i18n('icu:calling__return');
|
||||
onClick = returnToActiveCall;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue