Removes showContactModal in favor of redux action

This commit is contained in:
Josh Perez 2022-12-09 01:08:55 -05:00 committed by GitHub
parent 135c832748
commit 81e4564687
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 16 deletions

View file

@ -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;

View file

@ -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,

View file

@ -86,7 +86,6 @@ export type TimelinePropsType = ExternalProps &
| 'retrySend'
| 'scrollToQuotedMessage'
| 'showContactDetail'
| 'showContactModal'
| 'showExpiredIncomingTapToViewToast'
| 'showExpiredOutgoingTapToViewToast'
| 'showMessageDetail'

View file

@ -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<ConversationModel> {
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<ConversationModel> {
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<ConversationModel> {
retrySend,
retryDeleteForEveryone,
showContactDetail,
showContactModal,
showExpiredIncomingTapToViewToast,
showExpiredOutgoingTapToViewToast,
showMessageDetail,
@ -952,7 +946,10 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
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<ConversationModel> {
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<ConversationModel> {
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),