From 81e456468707a25c64ccb9f630806a3f9e99f8f9 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 9 Dec 2022 01:08:55 -0500 Subject: [PATCH] Removes showContactModal in favor of redux action --- ts/components/conversation/MessageDetail.tsx | 2 +- ts/state/smart/MessageDetail.tsx | 3 +-- ts/state/smart/Timeline.tsx | 1 - ts/views/conversation_view.tsx | 16 ++++------------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ts/components/conversation/MessageDetail.tsx b/ts/components/conversation/MessageDetail.tsx index aa6a3669a..93e604128 100644 --- a/ts/components/conversation/MessageDetail.tsx +++ b/ts/components/conversation/MessageDetail.tsx @@ -87,7 +87,6 @@ export type PropsBackboneActions = Pick< | 'openLink' | 'renderAudioAttachment' | 'showContactDetail' - | 'showContactModal' | 'showExpiredIncomingTapToViewToast' | 'showExpiredOutgoingTapToViewToast' | 'showVisualAttachment' @@ -99,6 +98,7 @@ export type PropsReduxActions = Pick< | 'clearSelectedMessage' | 'doubleCheckMissingQuoteReference' | 'checkForAccount' + | 'showContactModal' | 'viewStory' > & { toggleSafetyNumberModal: (contactId: string) => void; diff --git a/ts/state/smart/MessageDetail.tsx b/ts/state/smart/MessageDetail.tsx index b65a7dbc2..3264adc4a 100644 --- a/ts/state/smart/MessageDetail.tsx +++ b/ts/state/smart/MessageDetail.tsx @@ -24,6 +24,7 @@ export type OwnProps = Omit< | 'renderEmojiPicker' | 'renderReactionPicker' | 'theme' + | 'showContactModal' | 'markViewed' >; @@ -45,7 +46,6 @@ const mapStateToProps = ( openGiftBadge, openLink, showContactDetail, - showContactModal, showExpiredIncomingTapToViewToast, showExpiredOutgoingTapToViewToast, showVisualAttachment, @@ -84,7 +84,6 @@ const mapStateToProps = ( openLink, renderAudioAttachment, showContactDetail, - showContactModal, showExpiredIncomingTapToViewToast, showExpiredOutgoingTapToViewToast, showVisualAttachment, diff --git a/ts/state/smart/Timeline.tsx b/ts/state/smart/Timeline.tsx index 1cbef583d..15372b05e 100644 --- a/ts/state/smart/Timeline.tsx +++ b/ts/state/smart/Timeline.tsx @@ -86,7 +86,6 @@ export type TimelinePropsType = ExternalProps & | 'retrySend' | 'scrollToQuotedMessage' | 'showContactDetail' - | 'showContactModal' | 'showExpiredIncomingTapToViewToast' | 'showExpiredOutgoingTapToViewToast' | 'showMessageDetail' diff --git a/ts/views/conversation_view.tsx b/ts/views/conversation_view.tsx index 608a63ab1..314321c72 100644 --- a/ts/views/conversation_view.tsx +++ b/ts/views/conversation_view.tsx @@ -124,7 +124,6 @@ type MessageActionsType = { uuid: UUIDStringType; }; }) => unknown; - showContactModal: (contactId: string) => unknown; showExpiredIncomingTapToViewToast: () => unknown; showExpiredOutgoingTapToViewToast: () => unknown; showMessageDetail: (messageId: string) => unknown; @@ -182,7 +181,6 @@ export class ConversationView extends window.Backbone.View { this.listenTo(this.model, 'open-all-media', this.showAllMedia); this.listenTo(this.model, 'escape-pressed', this.resetPanel); this.listenTo(this.model, 'show-message-details', this.showMessageDetail); - this.listenTo(this.model, 'show-contact-modal', this.showContactModal); this.listenTo( this.model, 'toggle-reply', @@ -474,9 +472,6 @@ export class ConversationView extends window.Backbone.View { const showMessageDetail = (messageId: string) => { this.showMessageDetail(messageId); }; - const showContactModal = (contactId: string) => { - this.showContactModal(contactId); - }; const openConversation = (conversationId: string, messageId?: string) => { this.openConversation(conversationId, messageId); }; @@ -565,7 +560,6 @@ export class ConversationView extends window.Backbone.View { retrySend, retryDeleteForEveryone, showContactDetail, - showContactModal, showExpiredIncomingTapToViewToast, showExpiredOutgoingTapToViewToast, showMessageDetail, @@ -952,7 +946,10 @@ export class ConversationView extends window.Backbone.View { maxShownMemberCount={32} memberships={memberships} showContactModal={contactId => { - this.showContactModal(contactId); + window.reduxActions.globalModals.showContactModal( + contactId, + this.model.id + ); }} theme={theme} /> @@ -1264,10 +1261,6 @@ export class ConversationView extends window.Backbone.View { this.showLightboxForMedia(selectedMedia, media); } - showContactModal(contactId: string): void { - window.reduxActions.globalModals.showContactModal(contactId, this.model.id); - } - showGroupLinkManagement(): void { const view = new ReactWrapperView({ className: 'panel', @@ -1367,7 +1360,6 @@ export class ConversationView extends window.Backbone.View { addMembers: this.model.addMembersV2.bind(this.model), conversationId: this.model.get('id'), showAllMedia: this.showAllMedia.bind(this), - showContactModal: this.showContactModal.bind(this), showChatColorEditor: this.showChatColorEditor.bind(this), showGroupLinkManagement: this.showGroupLinkManagement.bind(this), showGroupV2Permissions: this.showGroupV2Permissions.bind(this),