Show a warning dialog when sending first edited message
This commit is contained in:
parent
23b058fe10
commit
4d354c8005
8 changed files with 175 additions and 23 deletions
|
@ -10,6 +10,7 @@ import type {
|
|||
FormattingWarningDataType,
|
||||
ForwardMessagesPropsType,
|
||||
SafetyNumberChangedBlockingDataType,
|
||||
SendEditWarningDataType,
|
||||
UserNotFoundModalStateType,
|
||||
} from '../state/ducks/globalModals';
|
||||
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||
|
@ -19,6 +20,7 @@ import { missingCaseError } from '../util/missingCaseError';
|
|||
import { ButtonVariant } from './Button';
|
||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
||||
import { FormattingWarningModal } from './FormattingWarningModal';
|
||||
import { SendEditWarningModal } from './SendEditWarningModal';
|
||||
import { SignalConnectionsModal } from './SignalConnectionsModal';
|
||||
import { WhatsNewModal } from './WhatsNewModal';
|
||||
|
||||
|
@ -59,6 +61,11 @@ export type PropsType = {
|
|||
// SafetyNumberModal
|
||||
safetyNumberModalContactId: string | undefined;
|
||||
renderSafetyNumber: () => JSX.Element;
|
||||
// SendEditWarningModal
|
||||
showSendEditWarningModal: (
|
||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined
|
||||
) => void;
|
||||
sendEditWarningData: SendEditWarningDataType | undefined;
|
||||
// ShortcutGuideModal
|
||||
isShortcutGuideModalVisible: boolean;
|
||||
renderShortcutGuideModal: () => JSX.Element;
|
||||
|
@ -119,6 +126,9 @@ export function GlobalModalContainer({
|
|||
// SafetyNumberModal
|
||||
safetyNumberModalContactId,
|
||||
renderSafetyNumber,
|
||||
// SendEditWarningDataType
|
||||
showSendEditWarningModal,
|
||||
sendEditWarningData,
|
||||
// ShortcutGuideModal
|
||||
isShortcutGuideModalVisible,
|
||||
renderShortcutGuideModal,
|
||||
|
@ -205,6 +215,23 @@ export function GlobalModalContainer({
|
|||
return renderProfileEditor();
|
||||
}
|
||||
|
||||
if (sendEditWarningData) {
|
||||
const { resolve } = sendEditWarningData.explodedPromise;
|
||||
return (
|
||||
<SendEditWarningModal
|
||||
i18n={i18n}
|
||||
onSendAnyway={() => {
|
||||
showSendEditWarningModal(undefined);
|
||||
resolve(true);
|
||||
}}
|
||||
onCancel={() => {
|
||||
showSendEditWarningModal(undefined);
|
||||
resolve(false);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (isShortcutGuideModalVisible) {
|
||||
return renderShortcutGuideModal();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue