Update shared groups when opening dialog
This commit is contained in:
parent
317138d545
commit
6a165da589
5 changed files with 17 additions and 1 deletions
|
@ -31,6 +31,7 @@ const getCommonProps = () => ({
|
||||||
onClose: action('onClose'),
|
onClose: action('onClose'),
|
||||||
showContactModal: action('showContactModal'),
|
showContactModal: action('showContactModal'),
|
||||||
toggleSignalConnectionsModal: action('toggleSignalConnectionsModal'),
|
toggleSignalConnectionsModal: action('toggleSignalConnectionsModal'),
|
||||||
|
updateSharedGroups: action('updateSharedGroups'),
|
||||||
removeMember: action('removeMember'),
|
removeMember: action('removeMember'),
|
||||||
theme: ThemeType.light,
|
theme: ThemeType.light,
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,6 +54,7 @@ export type PropsType = {
|
||||||
blockConversation: (conversationId: string) => unknown;
|
blockConversation: (conversationId: string) => unknown;
|
||||||
deleteConversation: (conversationId: string) => unknown;
|
deleteConversation: (conversationId: string) => unknown;
|
||||||
toggleSignalConnectionsModal: () => void;
|
toggleSignalConnectionsModal: () => void;
|
||||||
|
updateSharedGroups: (conversationId: string) => void;
|
||||||
getPreferredBadge: PreferredBadgeSelectorType;
|
getPreferredBadge: PreferredBadgeSelectorType;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
|
@ -79,6 +80,7 @@ export function ContactSpoofingReviewDialog(props: PropsType): JSX.Element {
|
||||||
conversationId,
|
conversationId,
|
||||||
deleteConversation,
|
deleteConversation,
|
||||||
toggleSignalConnectionsModal,
|
toggleSignalConnectionsModal,
|
||||||
|
updateSharedGroups,
|
||||||
getPreferredBadge,
|
getPreferredBadge,
|
||||||
i18n,
|
i18n,
|
||||||
onClose,
|
onClose,
|
||||||
|
@ -199,6 +201,7 @@ export function ContactSpoofingReviewDialog(props: PropsType): JSX.Element {
|
||||||
conversation={possiblyUnsafe.conversation}
|
conversation={possiblyUnsafe.conversation}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
||||||
|
updateSharedGroups={updateSharedGroups}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
isSignalConnection={possiblyUnsafe.isSignalConnection}
|
isSignalConnection={possiblyUnsafe.isSignalConnection}
|
||||||
|
@ -235,6 +238,7 @@ export function ContactSpoofingReviewDialog(props: PropsType): JSX.Element {
|
||||||
conversation={safe.conversation}
|
conversation={safe.conversation}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
||||||
|
updateSharedGroups={updateSharedGroups}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
showContactModal(safe.conversation.id);
|
showContactModal(safe.conversation.id);
|
||||||
|
@ -328,6 +332,7 @@ export function ContactSpoofingReviewDialog(props: PropsType): JSX.Element {
|
||||||
toggleSignalConnectionsModal={
|
toggleSignalConnectionsModal={
|
||||||
toggleSignalConnectionsModal
|
toggleSignalConnectionsModal
|
||||||
}
|
}
|
||||||
|
updateSharedGroups={updateSharedGroups}
|
||||||
getPreferredBadge={getPreferredBadge}
|
getPreferredBadge={getPreferredBadge}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
|
|
|
@ -26,6 +26,7 @@ export default {
|
||||||
i18n,
|
i18n,
|
||||||
onClick: action('onClick'),
|
onClick: action('onClick'),
|
||||||
toggleSignalConnectionsModal: action('toggleSignalConnectionsModal'),
|
toggleSignalConnectionsModal: action('toggleSignalConnectionsModal'),
|
||||||
|
updateSharedGroups: action('updateSharedGroups'),
|
||||||
getPreferredBadge: () => undefined,
|
getPreferredBadge: () => undefined,
|
||||||
conversation: getDefaultConversation(),
|
conversation: getDefaultConversation(),
|
||||||
theme: ThemeType.light,
|
theme: ThemeType.light,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
import type { ConversationType } from '../../state/ducks/conversations';
|
import type { ConversationType } from '../../state/ducks/conversations';
|
||||||
import type { LocalizerType, ThemeType } from '../../types/Util';
|
import type { LocalizerType, ThemeType } from '../../types/Util';
|
||||||
|
@ -22,6 +22,7 @@ export type PropsType = Readonly<{
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
toggleSignalConnectionsModal: () => void;
|
toggleSignalConnectionsModal: () => void;
|
||||||
|
updateSharedGroups: (conversationId: string) => void;
|
||||||
theme: ThemeType;
|
theme: ThemeType;
|
||||||
oldName: string | undefined;
|
oldName: string | undefined;
|
||||||
isSignalConnection: boolean;
|
isSignalConnection: boolean;
|
||||||
|
@ -34,6 +35,7 @@ export function ContactSpoofingReviewDialogPerson({
|
||||||
i18n,
|
i18n,
|
||||||
onClick,
|
onClick,
|
||||||
toggleSignalConnectionsModal,
|
toggleSignalConnectionsModal,
|
||||||
|
updateSharedGroups,
|
||||||
theme,
|
theme,
|
||||||
oldName,
|
oldName,
|
||||||
isSignalConnection,
|
isSignalConnection,
|
||||||
|
@ -43,6 +45,11 @@ export function ContactSpoofingReviewDialogPerson({
|
||||||
'<ContactSpoofingReviewDialogPerson> expected a direct conversation'
|
'<ContactSpoofingReviewDialogPerson> expected a direct conversation'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Kick off the expensive hydration of the current sharedGroupNames
|
||||||
|
updateSharedGroups(conversation.id);
|
||||||
|
}, [conversation.id, updateSharedGroups]);
|
||||||
|
|
||||||
const newName = conversation.profileName || conversation.title;
|
const newName = conversation.profileName || conversation.title;
|
||||||
|
|
||||||
let callout: JSX.Element | undefined;
|
let callout: JSX.Element | undefined;
|
||||||
|
|
|
@ -48,6 +48,7 @@ export function SmartContactSpoofingReviewDialog(
|
||||||
blockConversation,
|
blockConversation,
|
||||||
deleteConversation,
|
deleteConversation,
|
||||||
removeMember,
|
removeMember,
|
||||||
|
updateSharedGroups,
|
||||||
} = useConversationsActions();
|
} = useConversationsActions();
|
||||||
const { showContactModal, toggleSignalConnectionsModal } =
|
const { showContactModal, toggleSignalConnectionsModal } =
|
||||||
useGlobalModalActions();
|
useGlobalModalActions();
|
||||||
|
@ -79,6 +80,7 @@ export function SmartContactSpoofingReviewDialog(
|
||||||
getPreferredBadge,
|
getPreferredBadge,
|
||||||
i18n,
|
i18n,
|
||||||
removeMember,
|
removeMember,
|
||||||
|
updateSharedGroups,
|
||||||
showContactModal,
|
showContactModal,
|
||||||
toggleSignalConnectionsModal,
|
toggleSignalConnectionsModal,
|
||||||
theme,
|
theme,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue