Outgoing: Ensure that sends still succeed without CDS

This commit is contained in:
Scott Nonnenberg 2020-09-16 07:22:46 -07:00 committed by Josh Perez
parent ce067258a0
commit ec8ac1db58
4 changed files with 30 additions and 18 deletions

View file

@ -204,6 +204,12 @@ export class Lightbox extends React.Component<Props, State> {
public previousFocus: HTMLElement | null = null;
public constructor(props: Props) {
super(props);
this.state = {};
}
public componentDidMount(): void {
this.previousFocus = document.activeElement as HTMLElement;

View file

@ -302,7 +302,7 @@ export async function maybeUpdateGroup({
newRevision,
receivedAt,
sentAt,
}: MaybeUpdatePropsType) {
}: MaybeUpdatePropsType): Promise<void> {
const logId = conversation.idForLogging();
try {

View file

@ -23,10 +23,9 @@ export const SmartContactName: React.ComponentType<ExternalProps> = props => {
getConversationSelector
);
const conversation = getConversation(conversationId);
if (!conversation) {
throw new Error(`Conversation id ${conversationId} not found!`);
}
const conversation = getConversation(conversationId) || {
title: i18n('unknownContact'),
};
return <ContactName i18n={i18n} {...conversation} />;
};

View file

@ -584,6 +584,7 @@ export default class OutgoingMessage {
'sendToIdentifier: window.textsecure.messaging is not available!'
);
}
try {
const lookup = await window.textsecure.messaging.getUuidsForE164s([
identifier,
]);
@ -600,6 +601,12 @@ export default class OutgoingMessage {
new Error('User is not registered')
);
}
} catch (error) {
window.log.error(
`sentToIdentifier: Failed to fetch UUID for identifier ${identifier}`,
error && error.stack ? error.stack : error
);
}
} else {
throw new Error(
`sendToIdentifier: identifier ${identifier} was neither a UUID or E164`