From ec3c8d99ef028ce6ffd58e75ff30a9d074051e15 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Thu, 8 Dec 2022 19:49:54 -0500 Subject: [PATCH] Removes showForwardMessageModal from conversation_view --- ts/components/conversation/Quote.stories.tsx | 2 +- ts/components/conversation/Timeline.stories.tsx | 2 +- ts/components/conversation/Timeline.tsx | 2 +- ts/components/conversation/TimelineItem.stories.tsx | 2 +- ts/components/conversation/TimelineMessage.stories.tsx | 2 +- ts/components/conversation/TimelineMessage.tsx | 6 +++--- ts/state/smart/Stories.tsx | 4 +--- ts/state/smart/Timeline.tsx | 1 - ts/views/conversation_view.tsx | 10 +--------- 9 files changed, 10 insertions(+), 21 deletions(-) diff --git a/ts/components/conversation/Quote.stories.tsx b/ts/components/conversation/Quote.stories.tsx index d9100516a..b5d4ca3ba 100644 --- a/ts/components/conversation/Quote.stories.tsx +++ b/ts/components/conversation/Quote.stories.tsx @@ -138,7 +138,7 @@ const defaultMessageProps: TimelineMessagesProps = { showExpiredOutgoingTapToViewToast: action( 'showExpiredOutgoingTapToViewToast' ), - showForwardMessageModal: action('default--showForwardMessageModal'), + toggleForwardMessageModal: action('default--toggleForwardMessageModal'), showMessageDetail: action('default--showMessageDetail'), showVisualAttachment: action('default--showVisualAttachment'), startConversation: action('default--startConversation'), diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index 60cb78e2b..3e3a637ee 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -303,7 +303,7 @@ const actions = () => ({ showExpiredOutgoingTapToViewToast: action( 'showExpiredOutgoingTapToViewToast' ), - showForwardMessageModal: action('showForwardMessageModal'), + toggleForwardMessageModal: action('toggleForwardMessageModal'), showIdentity: action('showIdentity'), diff --git a/ts/components/conversation/Timeline.tsx b/ts/components/conversation/Timeline.tsx index 25da391a8..90fcb8d9d 100644 --- a/ts/components/conversation/Timeline.tsx +++ b/ts/components/conversation/Timeline.tsx @@ -242,7 +242,7 @@ const getActions = createSelector( 'replyToMessage', 'retryDeleteForEveryone', 'retrySend', - 'showForwardMessageModal', + 'toggleForwardMessageModal', 'deleteMessage', 'deleteMessageForEveryone', 'showMessageDetail', diff --git a/ts/components/conversation/TimelineItem.stories.tsx b/ts/components/conversation/TimelineItem.stories.tsx index 77bc68c6c..ba8f2656f 100644 --- a/ts/components/conversation/TimelineItem.stories.tsx +++ b/ts/components/conversation/TimelineItem.stories.tsx @@ -82,7 +82,7 @@ const getDefaultProps = () => ({ openGiftBadge: action('openGiftBadge'), showContactDetail: action('showContactDetail'), showContactModal: action('showContactModal'), - showForwardMessageModal: action('showForwardMessageModal'), + toggleForwardMessageModal: action('toggleForwardMessageModal'), showVisualAttachment: action('showVisualAttachment'), downloadAttachment: action('downloadAttachment'), displayTapToViewMessage: action('displayTapToViewMessage'), diff --git a/ts/components/conversation/TimelineMessage.stories.tsx b/ts/components/conversation/TimelineMessage.stories.tsx index 2f7bad69e..c7cec46f5 100644 --- a/ts/components/conversation/TimelineMessage.stories.tsx +++ b/ts/components/conversation/TimelineMessage.stories.tsx @@ -316,7 +316,7 @@ const createProps = (overrideProps: Partial = {}): Props => ({ showExpiredOutgoingTapToViewToast: action( 'showExpiredOutgoingTapToViewToast' ), - showForwardMessageModal: action('showForwardMessageModal'), + toggleForwardMessageModal: action('toggleForwardMessageModal'), showMessageDetail: action('showMessageDetail'), showVisualAttachment: action('showVisualAttachment'), startConversation: action('startConversation'), diff --git a/ts/components/conversation/TimelineMessage.tsx b/ts/components/conversation/TimelineMessage.tsx index 8ae71ccaa..0ffa8f8f6 100644 --- a/ts/components/conversation/TimelineMessage.tsx +++ b/ts/components/conversation/TimelineMessage.tsx @@ -42,7 +42,7 @@ export type PropsData = { export type PropsActions = { deleteMessage: (id: string) => void; deleteMessageForEveryone: (id: string) => void; - showForwardMessageModal: (id: string) => void; + toggleForwardMessageModal: (id: string) => void; reactToMessage: ( id: string, { emoji, remove }: { emoji: string; remove: boolean } @@ -100,7 +100,7 @@ export function TimelineMessage(props: Props): JSX.Element { retrySend, retryDeleteForEveryone, selectedReaction, - showForwardMessageModal, + toggleForwardMessageModal, showMessageDetail, text, timestamp, @@ -335,7 +335,7 @@ export function TimelineMessage(props: Props): JSX.Element { ? () => retryDeleteForEveryone(id) : undefined } - onForward={canForward ? () => showForwardMessageModal(id) : undefined} + onForward={canForward ? () => toggleForwardMessageModal(id) : undefined} onDeleteForMe={() => deleteMessage(id)} onDeleteForEveryone={ canDeleteForEveryone ? () => setHasDOEConfirmation(true) : undefined diff --git a/ts/state/smart/Stories.tsx b/ts/state/smart/Stories.tsx index c27230fc2..f26dd57b0 100644 --- a/ts/state/smart/Stories.tsx +++ b/ts/state/smart/Stories.tsx @@ -75,9 +75,7 @@ export function SmartStories(): JSX.Element | null { i18n={i18n} me={me} myStories={myStories} - onForwardStory={storyId => { - toggleForwardMessageModal(storyId); - }} + onForwardStory={toggleForwardMessageModal} onSaveStory={story => { if (story.attachment) { saveAttachment(story.attachment, story.timestamp); diff --git a/ts/state/smart/Timeline.tsx b/ts/state/smart/Timeline.tsx index 821bc69a8..635a5db82 100644 --- a/ts/state/smart/Timeline.tsx +++ b/ts/state/smart/Timeline.tsx @@ -89,7 +89,6 @@ export type TimelinePropsType = ExternalProps & | 'showContactModal' | 'showExpiredIncomingTapToViewToast' | 'showExpiredOutgoingTapToViewToast' - | 'showForwardMessageModal' | 'showIdentity' | 'showMessageDetail' | 'showVisualAttachment' diff --git a/ts/views/conversation_view.tsx b/ts/views/conversation_view.tsx index 421607ce0..6b4376517 100644 --- a/ts/views/conversation_view.tsx +++ b/ts/views/conversation_view.tsx @@ -128,7 +128,6 @@ type MessageActionsType = { showSafetyNumber: (contactId: string) => unknown; showExpiredIncomingTapToViewToast: () => unknown; showExpiredOutgoingTapToViewToast: () => unknown; - showForwardMessageModal: (messageId: string) => unknown; showIdentity: (conversationId: string) => unknown; showMessageDetail: (messageId: string) => unknown; showVisualAttachment: (options: { @@ -559,8 +558,6 @@ export class ConversationView extends window.Backbone.View { showToast(ToastTapToViewExpiredOutgoing); }; - const showForwardMessageModal = this.showForwardMessageModal.bind(this); - return { deleteMessage, displayTapToViewMessage, @@ -580,7 +577,6 @@ export class ConversationView extends window.Backbone.View { showSafetyNumber, showExpiredIncomingTapToViewToast, showExpiredOutgoingTapToViewToast, - showForwardMessageModal, showIdentity, showMessageDetail, showVisualAttachment, @@ -748,10 +744,6 @@ export class ConversationView extends window.Backbone.View { this.model.updateVerified(); } - async showForwardMessageModal(messageId: string): Promise { - window.reduxActions.globalModals.toggleForwardMessageModal(messageId); - } - showAllMedia(): void { if (document.querySelectorAll('.module-media-gallery').length) { return; @@ -1207,7 +1199,7 @@ export class ConversationView extends window.Backbone.View { getConversation: getConversationSelector(window.reduxStore.getState()), media, onForward: messageId => { - this.showForwardMessageModal(messageId); + window.reduxActions.globalModals.toggleForwardMessageModal(messageId); }, onSave, selectedIndex: selectedIndex >= 0 ? selectedIndex : 0,