Fix legacy call-history messages without a callId

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Jamie Kyle 2023-08-16 17:11:09 -07:00 committed by Jamie Kyle
parent 6f0401b847
commit ef0a3de636
17 changed files with 831 additions and 426 deletions

View file

@ -47,6 +47,9 @@ export type PropsType = CallingNotificationType &
export const CallingNotification: React.FC<PropsType> = React.memo(
function CallingNotificationInner(props) {
const { i18n } = props;
if (props.callHistory == null) {
return null;
}
const { type, direction, status, timestamp } = props.callHistory;
const icon = getCallingIcon(type, direction, status);
return (
@ -96,6 +99,10 @@ function renderCallingNotificationButton(
let disabledTooltipText: undefined | string;
let onClick: () => void;
if (props.callHistory == null) {
return null;
}
switch (props.callHistory.mode) {
case CallMode.Direct: {
const { direction, type } = props.callHistory;
@ -149,10 +156,6 @@ function renderCallingNotificationButton(
}
break;
}
case CallMode.None: {
log.error('renderCallingNotificationButton: Call mode cant be none');
return null;
}
default:
log.error(missingCaseError(props.callHistory.mode));
return null;