Fix Contact Modal and improve Debug Log window

This commit is contained in:
Scott Nonnenberg 2022-03-21 11:41:48 -07:00 committed by GitHub
parent 5d051ae16a
commit c369e44d8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 15 deletions

View file

@ -71,7 +71,7 @@ export const DebugLogWindow = ({
const linesToShow = Math.ceil(Math.min(window.innerHeight, 2000) / 5);
const value = fetchedLogText.split(/\n/g, linesToShow).join('\n');
setTextAreaValue(value);
setTextAreaValue(`${value}\n\n\n${i18n('debugLogLogIsIncomplete')}`);
setToastType(undefined);
}
@ -80,7 +80,7 @@ export const DebugLogWindow = ({
return () => {
shouldCancel = true;
};
}, [fetchLogs]);
}, [fetchLogs, i18n]);
const handleSubmit = async (ev: MouseEvent) => {
ev.preventDefault();

View file

@ -86,11 +86,11 @@ export const ContactModal = ({
);
useEffect(() => {
if (conversation?.id) {
if (contact?.id) {
// Kick off the expensive hydration of the current sharedGroupNames
updateConversationModelSharedGroups(conversation.id);
updateConversationModelSharedGroups(contact.id);
}
}, [conversation?.id, updateConversationModelSharedGroups]);
}, [contact?.id, updateConversationModelSharedGroups]);
let modalNode: ReactNode;
switch (subModalState) {

View file

@ -31,7 +31,7 @@ type PropsType = {
onBlockAndReportSpam: (conversationId: string) => unknown;
onClose: () => void;
onDelete: (conversationId: string) => unknown;
onShowContactModal: (contactId: string) => unknown;
onShowContactModal: (contactId: string, conversationId?: string) => unknown;
onUnblock: (conversationId: string) => unknown;
removeMember: (conversationId: string) => unknown;
theme: ThemeType;

View file

@ -294,7 +294,7 @@ export type PropsActions = {
contact: EmbeddedContactType;
signalAccount?: string;
}) => void;
showContactModal: (contactId: string) => void;
showContactModal: (contactId: string, conversationId?: string) => void;
kickOffAttachmentDownload: (options: {
attachment: AttachmentType;
@ -1380,12 +1380,13 @@ export class Message extends React.PureComponent<Props, State> {
private renderAvatar(): ReactNode {
const {
author,
conversationId,
conversationType,
direction,
getPreferredBadge,
i18n,
showContactModal,
theme,
conversationType,
direction,
} = this.props;
if (conversationType !== 'group' || direction !== 'incoming') {
@ -1415,7 +1416,7 @@ export class Message extends React.PureComponent<Props, State> {
event.stopPropagation();
event.preventDefault();
showContactModal(author.id);
showContactModal(author.id, conversationId);
}}
phoneNumber={author.phoneNumber}
profileName={author.profileName}

View file

@ -103,7 +103,7 @@ type ActionProps = {
deleteAvatarFromDisk: DeleteAvatarFromDiskActionType;
replaceAvatar: ReplaceAvatarActionType;
saveAvatarToDisk: SaveAvatarToDiskActionType;
showContactModal: (contactId: string, conversationId: string) => void;
showContactModal: (contactId: string, conversationId?: string) => void;
toggleSafetyNumberModal: (conversationId: string) => unknown;
searchInConversation: (id: string) => unknown;
};

View file

@ -26,7 +26,7 @@ export type Props = {
i18n: LocalizerType;
maxShownMemberCount?: number;
memberships: Array<GroupV2Membership>;
showContactModal: (contactId: string, conversationId: string) => void;
showContactModal: (contactId: string, conversationId?: string) => void;
startAddingNewMembers?: () => void;
theme: ThemeType;
};