diff --git a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx index 806a2a1dcf..7d5327fc8d 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx @@ -1,4 +1,4 @@ -// Copyright 2020 Signal Messenger, LLC +// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; @@ -65,7 +65,9 @@ const createProps = (hasGroupLink = false): Props => ({ showGroupV2Permissions: action('showGroupV2Permissions'), showPendingInvites: action('showPendingInvites'), showLightboxForMedia: action('showLightboxForMedia'), - updateGroupAttributes: action('updateGroupAttributes'), + updateGroupAttributes: async () => { + action('updateGroupAttributes')(); + }, onBlockAndDelete: action('onBlockAndDelete'), onDelete: action('onDelete'), }); diff --git a/ts/components/conversation/conversation-details/ConversationDetails.tsx b/ts/components/conversation/conversation-details/ConversationDetails.tsx index 73afc69428..6acc62bee2 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.tsx @@ -54,7 +54,7 @@ export type StateProps = { avatar?: undefined | ArrayBuffer; title?: string; }> - ) => void; + ) => Promise; onBlockAndDelete: () => void; onDelete: () => void; }; diff --git a/ts/state/smart/ConversationDetails.tsx b/ts/state/smart/ConversationDetails.tsx index 1437689f64..e04bbbb369 100644 --- a/ts/state/smart/ConversationDetails.tsx +++ b/ts/state/smart/ConversationDetails.tsx @@ -1,4 +1,4 @@ -// Copyright 2020 Signal Messenger, LLC +// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { connect } from 'react-redux'; @@ -35,7 +35,7 @@ export type SmartConversationDetailsProps = { avatar?: undefined | ArrayBuffer; title?: string; }> - ) => void; + ) => Promise; onBlockAndDelete: () => void; onDelete: () => void; }; diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index b6af9c56d1..a1351270d6 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -7,6 +7,7 @@ import { AttachmentType } from '../types/Attachment'; import { GroupV2PendingMemberType } from '../model-types.d'; import { MediaItemType } from '../components/LightboxGallery'; import { MessageType } from '../state/ducks/conversations'; +import { ConversationModel } from '../models/conversations'; type GetLinkPreviewImageResult = { data: ArrayBuffer; @@ -2851,7 +2852,7 @@ Whisper.ConversationView = Whisper.View.extend({ }, showConversationDetails() { - const conversation = this.model; + const conversation: ConversationModel = this.model; const messageRequestEnum = window.textsecure.protobuf.SyncMessage.MessageRequestResponse.Type; @@ -2881,10 +2882,11 @@ Whisper.ConversationView = Whisper.View.extend({ const ACCESS_ENUM = window.textsecure.protobuf.AccessControl.AccessRequired; - const hasGroupLink = + const hasGroupLink = Boolean( conversation.get('groupInviteLinkPassword') && - conversation.get('accessControl')?.addFromInviteLink !== - ACCESS_ENUM.UNSATISFIABLE; + conversation.get('accessControl')?.addFromInviteLink !== + ACCESS_ENUM.UNSATISFIABLE + ); const props = { addMembers: conversation.addMembersV2.bind(conversation),