Move getUntrustedContacts out of conversation_view

This commit is contained in:
Josh Perez 2022-08-16 19:59:11 -04:00 committed by GitHub
parent 96c4cc4bcf
commit 936ce91b2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 410 additions and 414 deletions

View file

@ -6,6 +6,7 @@ import type {
ContactModalStateType,
ForwardMessagePropsType,
UserNotFoundModalStateType,
SafetyNumberChangedBlockingDataType,
} from '../state/ducks/globalModals';
import type { LocalizerType } from '../types/Util';
import { missingCaseError } from '../util/missingCaseError';
@ -35,6 +36,10 @@ type PropsType = {
// StoriesSettings
isStoriesSettingsVisible: boolean;
renderStoriesSettings: () => JSX.Element;
// SendAnywayDialog
hasSafetyNumberChangeModal: boolean;
safetyNumberChangedBlockingData?: SafetyNumberChangedBlockingDataType;
renderSendAnywayDialog: () => JSX.Element;
// UserNotFoundModal
hideUserNotFoundModal: () => unknown;
userNotFoundModalState?: UserNotFoundModalStateType;
@ -63,6 +68,10 @@ export const GlobalModalContainer = ({
// StoriesSettings
isStoriesSettingsVisible,
renderStoriesSettings,
// SendAnywayDialog
hasSafetyNumberChangeModal,
safetyNumberChangedBlockingData,
renderSendAnywayDialog,
// UserNotFoundModal
hideUserNotFoundModal,
userNotFoundModalState,
@ -70,6 +79,12 @@ export const GlobalModalContainer = ({
hideWhatsNewModal,
isWhatsNewVisible,
}: PropsType): JSX.Element | null => {
// We want the send anyway dialog to supersede most modals since this is an
// immediate action the user needs to take.
if (hasSafetyNumberChangeModal || safetyNumberChangedBlockingData) {
return renderSendAnywayDialog();
}
if (safetyNumberModalContactId) {
return renderSafetyNumber();
}