Remove edit message/formatting onboarding
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
d64f77627c
commit
bef5fd6b34
12 changed files with 33 additions and 319 deletions
|
@ -3096,19 +3096,19 @@
|
||||||
},
|
},
|
||||||
"icu:SendEdit--dialog--title2": {
|
"icu:SendEdit--dialog--title2": {
|
||||||
"messageformat": "Edit Message",
|
"messageformat": "Edit Message",
|
||||||
"description": "Title of the modal shown before sending your first edit message"
|
"description": "(Deleted 2024/04/29) Title of the modal shown before sending your first edit message"
|
||||||
},
|
},
|
||||||
"icu:SendEdit--dialog--body2": {
|
"icu:SendEdit--dialog--body2": {
|
||||||
"messageformat": "If you edit a message, it will only be visible to people who are on the latest versions of Signal. They will be able to see you edited a message.",
|
"messageformat": "If you edit a message, it will only be visible to people who are on the latest versions of Signal. They will be able to see you edited a message.",
|
||||||
"description": "Body text of the modal shown before sending your first edit message"
|
"description": "(Deleted 2024/04/29) Body text of the modal shown before sending your first edit message"
|
||||||
},
|
},
|
||||||
"icu:SendFormatting--dialog--title": {
|
"icu:SendFormatting--dialog--title": {
|
||||||
"messageformat": "Sending formatted text",
|
"messageformat": "Sending formatted text",
|
||||||
"description": "Title of the modal shown before sending your first formatting message"
|
"description": "(Deleted 2024/04/29) Title of the modal shown before sending your first formatting message"
|
||||||
},
|
},
|
||||||
"icu:SendFormatting--dialog--body": {
|
"icu:SendFormatting--dialog--body": {
|
||||||
"messageformat": "Some people may be using a version of Signal that doesn’t support formatted text. They will not be able to see the formatting changes you’ve made to your message.",
|
"messageformat": "Some people may be using a version of Signal that doesn’t support formatted text. They will not be able to see the formatting changes you’ve made to your message.",
|
||||||
"description": "Body text of the modal shown before sending your first formatting message"
|
"description": "(Deleted 2024/04/29) Body text of the modal shown before sending your first formatting message"
|
||||||
},
|
},
|
||||||
"icu:AuthArtCreator--dialog--message": {
|
"icu:AuthArtCreator--dialog--message": {
|
||||||
"messageformat": "Would you like to open Signal Sticker Pack Creator?",
|
"messageformat": "Would you like to open Signal Sticker Pack Creator?",
|
||||||
|
|
|
@ -867,17 +867,6 @@ export async function startApp(): Promise<void> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.isBeforeVersion(lastVersion, '6.22.0-alpha')) {
|
|
||||||
const formattingWarningShown = window.storage.get(
|
|
||||||
'formattingWarningShown',
|
|
||||||
false
|
|
||||||
);
|
|
||||||
log.info(
|
|
||||||
`Clearing formattingWarningShown. Previous value was ${formattingWarningShown}`
|
|
||||||
);
|
|
||||||
await window.storage.put('formattingWarningShown', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.isBeforeVersion(lastVersion, 'v1.29.2-beta.1')) {
|
if (window.isBeforeVersion(lastVersion, 'v1.29.2-beta.1')) {
|
||||||
// Stickers flags
|
// Stickers flags
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
@ -946,6 +935,11 @@ export async function startApp(): Promise<void> {
|
||||||
await window.storage.remove('lastHeartbeat');
|
await window.storage.remove('lastHeartbeat');
|
||||||
await window.storage.remove('lastStartup');
|
await window.storage.remove('lastStartup');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.isBeforeVersion(lastVersion, 'v7.8.0-beta.1')) {
|
||||||
|
await window.storage.remove('sendEditWarningShown');
|
||||||
|
await window.storage.remove('formattingWarningShown');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setAppLoadingScreenMessage(
|
setAppLoadingScreenMessage(
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import type { LocalizerType } from '../types/Util';
|
|
||||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
|
||||||
|
|
||||||
type PropsType = {
|
|
||||||
i18n: LocalizerType;
|
|
||||||
onSendAnyway: () => void;
|
|
||||||
onCancel: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function FormattingWarningModal({
|
|
||||||
i18n,
|
|
||||||
onSendAnyway,
|
|
||||||
onCancel,
|
|
||||||
}: PropsType): JSX.Element | null {
|
|
||||||
return (
|
|
||||||
<ConfirmationDialog
|
|
||||||
actions={[
|
|
||||||
{
|
|
||||||
action: onSendAnyway,
|
|
||||||
autoClose: true,
|
|
||||||
style: 'affirmative',
|
|
||||||
text: i18n('icu:sendAnyway'),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
dialogName="FormattingWarningModal"
|
|
||||||
i18n={i18n}
|
|
||||||
onCancel={onCancel}
|
|
||||||
onClose={onCancel}
|
|
||||||
title={i18n('icu:SendFormatting--dialog--title')}
|
|
||||||
>
|
|
||||||
{i18n('icu:SendFormatting--dialog--body')}
|
|
||||||
</ConfirmationDialog>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -8,22 +8,17 @@ import type {
|
||||||
DeleteMessagesPropsType,
|
DeleteMessagesPropsType,
|
||||||
EditHistoryMessagesType,
|
EditHistoryMessagesType,
|
||||||
EditNicknameAndNoteModalPropsType,
|
EditNicknameAndNoteModalPropsType,
|
||||||
FormattingWarningDataType,
|
|
||||||
ForwardMessagesPropsType,
|
ForwardMessagesPropsType,
|
||||||
MessageRequestActionsConfirmationPropsType,
|
MessageRequestActionsConfirmationPropsType,
|
||||||
SafetyNumberChangedBlockingDataType,
|
SafetyNumberChangedBlockingDataType,
|
||||||
SendEditWarningDataType,
|
|
||||||
UserNotFoundModalStateType,
|
UserNotFoundModalStateType,
|
||||||
} from '../state/ducks/globalModals';
|
} from '../state/ducks/globalModals';
|
||||||
import type { LocalizerType, ThemeType } from '../types/Util';
|
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||||
import { UsernameOnboardingState } from '../types/globalModals';
|
import { UsernameOnboardingState } from '../types/globalModals';
|
||||||
import type { ExplodePromiseResultType } from '../util/explodePromise';
|
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
|
|
||||||
import { ButtonVariant } from './Button';
|
import { ButtonVariant } from './Button';
|
||||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
import { ConfirmationDialog } from './ConfirmationDialog';
|
||||||
import { FormattingWarningModal } from './FormattingWarningModal';
|
|
||||||
import { SendEditWarningModal } from './SendEditWarningModal';
|
|
||||||
import { SignalConnectionsModal } from './SignalConnectionsModal';
|
import { SignalConnectionsModal } from './SignalConnectionsModal';
|
||||||
import { WhatsNewModal } from './WhatsNewModal';
|
import { WhatsNewModal } from './WhatsNewModal';
|
||||||
|
|
||||||
|
@ -56,11 +51,6 @@ export type PropsType = {
|
||||||
// DeleteMessageModal
|
// DeleteMessageModal
|
||||||
deleteMessagesProps: DeleteMessagesPropsType | undefined;
|
deleteMessagesProps: DeleteMessagesPropsType | undefined;
|
||||||
renderDeleteMessagesModal: () => JSX.Element;
|
renderDeleteMessagesModal: () => JSX.Element;
|
||||||
// FormattingWarningModal
|
|
||||||
showFormattingWarningModal: (
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined
|
|
||||||
) => void;
|
|
||||||
formattingWarningData: FormattingWarningDataType | undefined;
|
|
||||||
// ForwardMessageModal
|
// ForwardMessageModal
|
||||||
forwardMessagesProps: ForwardMessagesPropsType | undefined;
|
forwardMessagesProps: ForwardMessagesPropsType | undefined;
|
||||||
renderForwardMessagesModal: () => JSX.Element;
|
renderForwardMessagesModal: () => JSX.Element;
|
||||||
|
@ -76,11 +66,6 @@ export type PropsType = {
|
||||||
// SafetyNumberModal
|
// SafetyNumberModal
|
||||||
safetyNumberModalContactId: string | undefined;
|
safetyNumberModalContactId: string | undefined;
|
||||||
renderSafetyNumber: () => JSX.Element;
|
renderSafetyNumber: () => JSX.Element;
|
||||||
// SendEditWarningModal
|
|
||||||
showSendEditWarningModal: (
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined
|
|
||||||
) => void;
|
|
||||||
sendEditWarningData: SendEditWarningDataType | undefined;
|
|
||||||
// ShortcutGuideModal
|
// ShortcutGuideModal
|
||||||
isShortcutGuideModalVisible: boolean;
|
isShortcutGuideModalVisible: boolean;
|
||||||
renderShortcutGuideModal: () => JSX.Element;
|
renderShortcutGuideModal: () => JSX.Element;
|
||||||
|
@ -138,9 +123,6 @@ export function GlobalModalContainer({
|
||||||
// DeleteMessageModal
|
// DeleteMessageModal
|
||||||
deleteMessagesProps,
|
deleteMessagesProps,
|
||||||
renderDeleteMessagesModal,
|
renderDeleteMessagesModal,
|
||||||
// FormattingWarningModal
|
|
||||||
showFormattingWarningModal,
|
|
||||||
formattingWarningData,
|
|
||||||
// ForwardMessageModal
|
// ForwardMessageModal
|
||||||
forwardMessagesProps,
|
forwardMessagesProps,
|
||||||
renderForwardMessagesModal,
|
renderForwardMessagesModal,
|
||||||
|
@ -156,9 +138,6 @@ export function GlobalModalContainer({
|
||||||
// SafetyNumberModal
|
// SafetyNumberModal
|
||||||
safetyNumberModalContactId,
|
safetyNumberModalContactId,
|
||||||
renderSafetyNumber,
|
renderSafetyNumber,
|
||||||
// SendEditWarningDataType
|
|
||||||
showSendEditWarningModal,
|
|
||||||
sendEditWarningData,
|
|
||||||
// ShortcutGuideModal
|
// ShortcutGuideModal
|
||||||
isShortcutGuideModalVisible,
|
isShortcutGuideModalVisible,
|
||||||
renderShortcutGuideModal,
|
renderShortcutGuideModal,
|
||||||
|
@ -226,23 +205,6 @@ export function GlobalModalContainer({
|
||||||
return renderDeleteMessagesModal();
|
return renderDeleteMessagesModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formattingWarningData) {
|
|
||||||
const { resolve } = formattingWarningData.explodedPromise;
|
|
||||||
return (
|
|
||||||
<FormattingWarningModal
|
|
||||||
i18n={i18n}
|
|
||||||
onSendAnyway={() => {
|
|
||||||
showFormattingWarningModal(undefined);
|
|
||||||
resolve(true);
|
|
||||||
}}
|
|
||||||
onCancel={() => {
|
|
||||||
showFormattingWarningModal(undefined);
|
|
||||||
resolve(false);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (forwardMessagesProps) {
|
if (forwardMessagesProps) {
|
||||||
return renderForwardMessagesModal();
|
return renderForwardMessagesModal();
|
||||||
}
|
}
|
||||||
|
@ -259,23 +221,6 @@ export function GlobalModalContainer({
|
||||||
return renderProfileEditor();
|
return renderProfileEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendEditWarningData) {
|
|
||||||
const { resolve } = sendEditWarningData.explodedPromise;
|
|
||||||
return (
|
|
||||||
<SendEditWarningModal
|
|
||||||
i18n={i18n}
|
|
||||||
onSendAnyway={() => {
|
|
||||||
showSendEditWarningModal(undefined);
|
|
||||||
resolve(true);
|
|
||||||
}}
|
|
||||||
onCancel={() => {
|
|
||||||
showSendEditWarningModal(undefined);
|
|
||||||
resolve(false);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isShortcutGuideModalVisible) {
|
if (isShortcutGuideModalVisible) {
|
||||||
return renderShortcutGuideModal();
|
return renderShortcutGuideModal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import type { LocalizerType } from '../types/Util';
|
|
||||||
import { ConfirmationDialog } from './ConfirmationDialog';
|
|
||||||
|
|
||||||
type PropsType = {
|
|
||||||
i18n: LocalizerType;
|
|
||||||
onSendAnyway: () => void;
|
|
||||||
onCancel: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function SendEditWarningModal({
|
|
||||||
i18n,
|
|
||||||
onSendAnyway,
|
|
||||||
onCancel,
|
|
||||||
}: PropsType): JSX.Element | null {
|
|
||||||
return (
|
|
||||||
<ConfirmationDialog
|
|
||||||
actions={[
|
|
||||||
{
|
|
||||||
action: onSendAnyway,
|
|
||||||
autoClose: true,
|
|
||||||
style: 'affirmative',
|
|
||||||
text: i18n('icu:sendAnyway'),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
dialogName="SendEditWarningModal"
|
|
||||||
i18n={i18n}
|
|
||||||
onCancel={onCancel}
|
|
||||||
onClose={onCancel}
|
|
||||||
title={i18n('icu:SendEdit--dialog--title2')}
|
|
||||||
>
|
|
||||||
{i18n('icu:SendEdit--dialog--body2')}
|
|
||||||
</ConfirmationDialog>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -20,7 +20,6 @@ import {
|
||||||
} from '../../types/Attachment';
|
} from '../../types/Attachment';
|
||||||
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions';
|
import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions';
|
||||||
import type { DraftBodyRanges } from '../../types/BodyRange';
|
import type { DraftBodyRanges } from '../../types/BodyRange';
|
||||||
import { BodyRange } from '../../types/BodyRange';
|
|
||||||
import type { LinkPreviewType } from '../../types/message/LinkPreviews';
|
import type { LinkPreviewType } from '../../types/message/LinkPreviews';
|
||||||
import type { MessageAttributesType } from '../../model-types.d';
|
import type { MessageAttributesType } from '../../model-types.d';
|
||||||
import type { NoopActionType } from './noop';
|
import type { NoopActionType } from './noop';
|
||||||
|
@ -90,8 +89,6 @@ import { drop } from '../../util/drop';
|
||||||
import { strictAssert } from '../../util/assert';
|
import { strictAssert } from '../../util/assert';
|
||||||
import { makeQuote } from '../../util/makeQuote';
|
import { makeQuote } from '../../util/makeQuote';
|
||||||
import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage';
|
import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage';
|
||||||
import { maybeBlockSendForFormattingModal } from '../../util/maybeBlockSendForFormattingModal';
|
|
||||||
import { maybeBlockSendForEditWarningModal } from '../../util/maybeBlockSendForEditWarningModal';
|
|
||||||
import { Sound, SoundType } from '../../util/Sound';
|
import { Sound, SoundType } from '../../util/Sound';
|
||||||
import {
|
import {
|
||||||
isImageTypeSupported,
|
isImageTypeSupported,
|
||||||
|
@ -390,9 +387,7 @@ export function handleLeaveConversation(
|
||||||
|
|
||||||
// eslint-disable-next-line local-rules/type-alias-readonlydeep
|
// eslint-disable-next-line local-rules/type-alias-readonlydeep
|
||||||
type WithPreSendChecksOptions = Readonly<{
|
type WithPreSendChecksOptions = Readonly<{
|
||||||
bodyRanges?: DraftBodyRanges;
|
|
||||||
message?: string;
|
message?: string;
|
||||||
isEditedMessage?: boolean;
|
|
||||||
voiceNoteAttachment?: InMemoryAttachmentDraftType;
|
voiceNoteAttachment?: InMemoryAttachmentDraftType;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
@ -416,7 +411,7 @@ async function withPreSendChecks(
|
||||||
conversation.attributes,
|
conversation.attributes,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { bodyRanges, isEditedMessage, message, voiceNoteAttachment } = options;
|
const { message, voiceNoteAttachment } = options;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dispatch(setComposerDisabledState(conversationId, true));
|
dispatch(setComposerDisabledState(conversationId, true));
|
||||||
|
@ -438,45 +433,6 @@ async function withPreSendChecks(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const hasFormatting = bodyRanges?.some(BodyRange.isFormatting);
|
|
||||||
if (hasFormatting && !window.storage.get('formattingWarningShown')) {
|
|
||||||
const sendAnyway = await maybeBlockSendForFormattingModal();
|
|
||||||
if (!sendAnyway) {
|
|
||||||
dispatch(setComposerDisabledState(conversationId, false));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
drop(window.storage.put('formattingWarningShown', true));
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
log.error(
|
|
||||||
'withPreSendChecks block for formatting modal:',
|
|
||||||
Errors.toLogFormat(error)
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (
|
|
||||||
isEditedMessage &&
|
|
||||||
!window.storage.get('sendEditWarningShown') &&
|
|
||||||
!window.SignalCI
|
|
||||||
) {
|
|
||||||
const sendAnyway = await maybeBlockSendForEditWarningModal();
|
|
||||||
if (!sendAnyway) {
|
|
||||||
dispatch(setComposerDisabledState(conversationId, false));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
drop(window.storage.put('sendEditWarningShown', true));
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
log.error(
|
|
||||||
'withPreSendChecks block for send edit warning modal:',
|
|
||||||
Errors.toLogFormat(error)
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const toast = shouldShowInvalidMessageToast(conversation.attributes);
|
const toast = shouldShowInvalidMessageToast(conversation.attributes);
|
||||||
if (toast != null) {
|
if (toast != null) {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
@ -510,6 +466,7 @@ async function withPreSendChecks(
|
||||||
function sendEditedMessage(
|
function sendEditedMessage(
|
||||||
conversationId: string,
|
conversationId: string,
|
||||||
options: WithPreSendChecksOptions & {
|
options: WithPreSendChecksOptions & {
|
||||||
|
bodyRanges?: DraftBodyRanges;
|
||||||
targetMessageId: string;
|
targetMessageId: string;
|
||||||
quoteAuthorAci?: AciString;
|
quoteAuthorAci?: AciString;
|
||||||
quoteSentAt?: number;
|
quoteSentAt?: number;
|
||||||
|
@ -534,11 +491,7 @@ function sendEditedMessage(
|
||||||
targetMessageId,
|
targetMessageId,
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
await withPreSendChecks(
|
await withPreSendChecks(conversationId, options, dispatch, async () => {
|
||||||
conversationId,
|
|
||||||
{ ...options, isEditedMessage: true },
|
|
||||||
dispatch,
|
|
||||||
async () => {
|
|
||||||
try {
|
try {
|
||||||
await doSendEditedMessage(conversationId, {
|
await doSendEditedMessage(conversationId, {
|
||||||
body: message,
|
body: message,
|
||||||
|
@ -559,14 +512,14 @@ function sendEditedMessage(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendMultiMediaMessage(
|
function sendMultiMediaMessage(
|
||||||
conversationId: string,
|
conversationId: string,
|
||||||
options: WithPreSendChecksOptions & {
|
options: WithPreSendChecksOptions & {
|
||||||
|
bodyRanges?: DraftBodyRanges;
|
||||||
draftAttachments?: ReadonlyArray<AttachmentDraftType>;
|
draftAttachments?: ReadonlyArray<AttachmentDraftType>;
|
||||||
timestamp?: number;
|
timestamp?: number;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,12 +73,6 @@ export type SafetyNumberChangedBlockingDataType = ReadonlyDeep<{
|
||||||
promiseUuid: SingleServePromise.SingleServePromiseIdString;
|
promiseUuid: SingleServePromise.SingleServePromiseIdString;
|
||||||
source?: SafetyNumberChangeSource;
|
source?: SafetyNumberChangeSource;
|
||||||
}>;
|
}>;
|
||||||
export type FormattingWarningDataType = ReadonlyDeep<{
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean>;
|
|
||||||
}>;
|
|
||||||
export type SendEditWarningDataType = ReadonlyDeep<{
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean>;
|
|
||||||
}>;
|
|
||||||
export type AuthorizeArtCreatorDataType =
|
export type AuthorizeArtCreatorDataType =
|
||||||
ReadonlyDeep<AuthorizeArtCreatorOptionsType>;
|
ReadonlyDeep<AuthorizeArtCreatorOptionsType>;
|
||||||
|
|
||||||
|
@ -103,7 +97,6 @@ export type GlobalModalsStateType = ReadonlyDeep<{
|
||||||
description?: string;
|
description?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
};
|
};
|
||||||
formattingWarningData?: FormattingWarningDataType;
|
|
||||||
forwardMessagesProps?: ForwardMessagesPropsType;
|
forwardMessagesProps?: ForwardMessagesPropsType;
|
||||||
gv2MigrationProps?: MigrateToGV2PropsType;
|
gv2MigrationProps?: MigrateToGV2PropsType;
|
||||||
hasConfirmationModal: boolean;
|
hasConfirmationModal: boolean;
|
||||||
|
@ -120,7 +113,6 @@ export type GlobalModalsStateType = ReadonlyDeep<{
|
||||||
profileEditorInitialEditState: ProfileEditorEditState | undefined;
|
profileEditorInitialEditState: ProfileEditorEditState | undefined;
|
||||||
safetyNumberChangedBlockingData?: SafetyNumberChangedBlockingDataType;
|
safetyNumberChangedBlockingData?: SafetyNumberChangedBlockingDataType;
|
||||||
safetyNumberModalContactId?: string;
|
safetyNumberModalContactId?: string;
|
||||||
sendEditWarningData?: SendEditWarningDataType;
|
|
||||||
stickerPackPreviewId?: string;
|
stickerPackPreviewId?: string;
|
||||||
userNotFoundModalState?: UserNotFoundModalStateType;
|
userNotFoundModalState?: UserNotFoundModalStateType;
|
||||||
}>;
|
}>;
|
||||||
|
@ -163,10 +155,6 @@ const TOGGLE_EDIT_NICKNAME_AND_NOTE_MODAL =
|
||||||
'globalModals/TOGGLE_EDIT_NICKNAME_AND_NOTE_MODAL';
|
'globalModals/TOGGLE_EDIT_NICKNAME_AND_NOTE_MODAL';
|
||||||
const TOGGLE_MESSAGE_REQUEST_ACTIONS_CONFIRMATION =
|
const TOGGLE_MESSAGE_REQUEST_ACTIONS_CONFIRMATION =
|
||||||
'globalModals/TOGGLE_MESSAGE_REQUEST_ACTIONS_CONFIRMATION';
|
'globalModals/TOGGLE_MESSAGE_REQUEST_ACTIONS_CONFIRMATION';
|
||||||
const SHOW_FORMATTING_WARNING_MODAL =
|
|
||||||
'globalModals/SHOW_FORMATTING_WARNING_MODAL';
|
|
||||||
const SHOW_SEND_EDIT_WARNING_MODAL =
|
|
||||||
'globalModals/SHOW_SEND_EDIT_WARNING_MODAL';
|
|
||||||
const CLOSE_SHORTCUT_GUIDE_MODAL = 'globalModals/CLOSE_SHORTCUT_GUIDE_MODAL';
|
const CLOSE_SHORTCUT_GUIDE_MODAL = 'globalModals/CLOSE_SHORTCUT_GUIDE_MODAL';
|
||||||
const SHOW_SHORTCUT_GUIDE_MODAL = 'globalModals/SHOW_SHORTCUT_GUIDE_MODAL';
|
const SHOW_SHORTCUT_GUIDE_MODAL = 'globalModals/SHOW_SHORTCUT_GUIDE_MODAL';
|
||||||
const SHOW_AUTH_ART_CREATOR = 'globalModals/SHOW_AUTH_ART_CREATOR';
|
const SHOW_AUTH_ART_CREATOR = 'globalModals/SHOW_AUTH_ART_CREATOR';
|
||||||
|
@ -280,20 +268,6 @@ type ShowStoriesSettingsActionType = ReadonlyDeep<{
|
||||||
type: typeof SHOW_STORIES_SETTINGS;
|
type: typeof SHOW_STORIES_SETTINGS;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
type ShowFormattingWarningModalActionType = ReadonlyDeep<{
|
|
||||||
type: typeof SHOW_FORMATTING_WARNING_MODAL;
|
|
||||||
payload: {
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined;
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
|
|
||||||
type ShowSendEditWarningModalActionType = ReadonlyDeep<{
|
|
||||||
type: typeof SHOW_SEND_EDIT_WARNING_MODAL;
|
|
||||||
payload: {
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined;
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
|
|
||||||
type HideStoriesSettingsActionType = ReadonlyDeep<{
|
type HideStoriesSettingsActionType = ReadonlyDeep<{
|
||||||
type: typeof HIDE_STORIES_SETTINGS;
|
type: typeof HIDE_STORIES_SETTINGS;
|
||||||
}>;
|
}>;
|
||||||
|
@ -409,9 +383,7 @@ export type GlobalModalsActionType = ReadonlyDeep<
|
||||||
| ShowErrorModalActionType
|
| ShowErrorModalActionType
|
||||||
| ToggleEditNicknameAndNoteModalActionType
|
| ToggleEditNicknameAndNoteModalActionType
|
||||||
| ToggleMessageRequestActionsConfirmationActionType
|
| ToggleMessageRequestActionsConfirmationActionType
|
||||||
| ShowFormattingWarningModalActionType
|
|
||||||
| ShowSendAnywayDialogActionType
|
| ShowSendAnywayDialogActionType
|
||||||
| ShowSendEditWarningModalActionType
|
|
||||||
| ShowShortcutGuideModalActionType
|
| ShowShortcutGuideModalActionType
|
||||||
| ShowStickerPackPreviewActionType
|
| ShowStickerPackPreviewActionType
|
||||||
| ShowStoriesSettingsActionType
|
| ShowStoriesSettingsActionType
|
||||||
|
@ -453,8 +425,6 @@ export const actions = {
|
||||||
showErrorModal,
|
showErrorModal,
|
||||||
toggleEditNicknameAndNoteModal,
|
toggleEditNicknameAndNoteModal,
|
||||||
toggleMessageRequestActionsConfirmation,
|
toggleMessageRequestActionsConfirmation,
|
||||||
showFormattingWarningModal,
|
|
||||||
showSendEditWarningModal,
|
|
||||||
showGV2MigrationDialog,
|
showGV2MigrationDialog,
|
||||||
showShortcutGuideModal,
|
showShortcutGuideModal,
|
||||||
showStickerPackPreview,
|
showStickerPackPreview,
|
||||||
|
@ -532,18 +502,6 @@ function showStoriesSettings(): ShowStoriesSettingsActionType {
|
||||||
return { type: SHOW_STORIES_SETTINGS };
|
return { type: SHOW_STORIES_SETTINGS };
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFormattingWarningModal(
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined
|
|
||||||
): ShowFormattingWarningModalActionType {
|
|
||||||
return { type: SHOW_FORMATTING_WARNING_MODAL, payload: { explodedPromise } };
|
|
||||||
}
|
|
||||||
|
|
||||||
function showSendEditWarningModal(
|
|
||||||
explodedPromise: ExplodePromiseResultType<boolean> | undefined
|
|
||||||
): ShowSendEditWarningModalActionType {
|
|
||||||
return { type: SHOW_SEND_EDIT_WARNING_MODAL, payload: { explodedPromise } };
|
|
||||||
}
|
|
||||||
|
|
||||||
function showGV2MigrationDialog(
|
function showGV2MigrationDialog(
|
||||||
conversationId: string
|
conversationId: string
|
||||||
): ThunkAction<void, RootStateType, unknown, StartMigrationToGV2ActionType> {
|
): ThunkAction<void, RootStateType, unknown, StartMigrationToGV2ActionType> {
|
||||||
|
@ -1161,36 +1119,6 @@ export function reducer(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action.type === SHOW_FORMATTING_WARNING_MODAL) {
|
|
||||||
const { explodedPromise } = action.payload;
|
|
||||||
if (!explodedPromise) {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
formattingWarningData: undefined,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
formattingWarningData: { explodedPromise },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action.type === SHOW_SEND_EDIT_WARNING_MODAL) {
|
|
||||||
const { explodedPromise } = action.payload;
|
|
||||||
if (!explodedPromise) {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
sendEditWarningData: undefined,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
sendEditWarningData: { explodedPromise },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action.type === SHOW_STICKER_PACK_PREVIEW) {
|
if (action.type === SHOW_STICKER_PACK_PREVIEW) {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|
|
@ -96,7 +96,6 @@ export const SmartGlobalModalContainer = memo(
|
||||||
editHistoryMessages,
|
editHistoryMessages,
|
||||||
editNicknameAndNoteModalProps,
|
editNicknameAndNoteModalProps,
|
||||||
errorModalProps,
|
errorModalProps,
|
||||||
formattingWarningData,
|
|
||||||
forwardMessagesProps,
|
forwardMessagesProps,
|
||||||
messageRequestActionsConfirmationProps,
|
messageRequestActionsConfirmationProps,
|
||||||
notePreviewModalProps,
|
notePreviewModalProps,
|
||||||
|
@ -109,7 +108,6 @@ export const SmartGlobalModalContainer = memo(
|
||||||
usernameOnboardingState,
|
usernameOnboardingState,
|
||||||
safetyNumberChangedBlockingData,
|
safetyNumberChangedBlockingData,
|
||||||
safetyNumberModalContactId,
|
safetyNumberModalContactId,
|
||||||
sendEditWarningData,
|
|
||||||
stickerPackPreviewId,
|
stickerPackPreviewId,
|
||||||
userNotFoundModalState,
|
userNotFoundModalState,
|
||||||
} = useSelector(getGlobalModalsState);
|
} = useSelector(getGlobalModalsState);
|
||||||
|
@ -120,8 +118,6 @@ export const SmartGlobalModalContainer = memo(
|
||||||
confirmAuthorizeArtCreator,
|
confirmAuthorizeArtCreator,
|
||||||
hideUserNotFoundModal,
|
hideUserNotFoundModal,
|
||||||
hideWhatsNewModal,
|
hideWhatsNewModal,
|
||||||
showFormattingWarningModal,
|
|
||||||
showSendEditWarningModal,
|
|
||||||
toggleSignalConnectionsModal,
|
toggleSignalConnectionsModal,
|
||||||
} = useGlobalModalActions();
|
} = useGlobalModalActions();
|
||||||
|
|
||||||
|
@ -181,7 +177,6 @@ export const SmartGlobalModalContainer = memo(
|
||||||
editNicknameAndNoteModalProps={editNicknameAndNoteModalProps}
|
editNicknameAndNoteModalProps={editNicknameAndNoteModalProps}
|
||||||
errorModalProps={errorModalProps}
|
errorModalProps={errorModalProps}
|
||||||
deleteMessagesProps={deleteMessagesProps}
|
deleteMessagesProps={deleteMessagesProps}
|
||||||
formattingWarningData={formattingWarningData}
|
|
||||||
forwardMessagesProps={forwardMessagesProps}
|
forwardMessagesProps={forwardMessagesProps}
|
||||||
messageRequestActionsConfirmationProps={
|
messageRequestActionsConfirmationProps={
|
||||||
messageRequestActionsConfirmationProps
|
messageRequestActionsConfirmationProps
|
||||||
|
@ -218,9 +213,6 @@ export const SmartGlobalModalContainer = memo(
|
||||||
renderStoriesSettings={renderStoriesSettings}
|
renderStoriesSettings={renderStoriesSettings}
|
||||||
safetyNumberChangedBlockingData={safetyNumberChangedBlockingData}
|
safetyNumberChangedBlockingData={safetyNumberChangedBlockingData}
|
||||||
safetyNumberModalContactId={safetyNumberModalContactId}
|
safetyNumberModalContactId={safetyNumberModalContactId}
|
||||||
sendEditWarningData={sendEditWarningData}
|
|
||||||
showFormattingWarningModal={showFormattingWarningModal}
|
|
||||||
showSendEditWarningModal={showSendEditWarningModal}
|
|
||||||
stickerPackPreviewId={stickerPackPreviewId}
|
stickerPackPreviewId={stickerPackPreviewId}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
toggleSignalConnectionsModal={toggleSignalConnectionsModal}
|
||||||
|
|
4
ts/types/Storage.d.ts
vendored
4
ts/types/Storage.d.ts
vendored
|
@ -67,7 +67,6 @@ export type StorageAccessType = {
|
||||||
customColors: CustomColorsItemType;
|
customColors: CustomColorsItemType;
|
||||||
device_name: string;
|
device_name: string;
|
||||||
existingOnboardingStoryMessageIds: ReadonlyArray<string> | undefined;
|
existingOnboardingStoryMessageIds: ReadonlyArray<string> | undefined;
|
||||||
formattingWarningShown: boolean;
|
|
||||||
hasRegisterSupportForUnauthenticatedDelivery: boolean;
|
hasRegisterSupportForUnauthenticatedDelivery: boolean;
|
||||||
hasSetMyStoriesPrivacy: boolean;
|
hasSetMyStoriesPrivacy: boolean;
|
||||||
hasCompletedUsernameOnboarding: boolean;
|
hasCompletedUsernameOnboarding: boolean;
|
||||||
|
@ -92,7 +91,6 @@ export type StorageAccessType = {
|
||||||
regionCode: string;
|
regionCode: string;
|
||||||
registrationIdMap: Record<ServiceIdString, number>;
|
registrationIdMap: Record<ServiceIdString, number>;
|
||||||
remoteBuildExpiration: number;
|
remoteBuildExpiration: number;
|
||||||
sendEditWarningShown: boolean;
|
|
||||||
sessionResets: SessionResetsType;
|
sessionResets: SessionResetsType;
|
||||||
showStickerPickerHint: boolean;
|
showStickerPickerHint: boolean;
|
||||||
showStickersIntroduction: boolean;
|
showStickersIntroduction: boolean;
|
||||||
|
@ -175,6 +173,8 @@ export type StorageAccessType = {
|
||||||
signedKeyRotationRejected: number;
|
signedKeyRotationRejected: number;
|
||||||
lastHeartbeat: never;
|
lastHeartbeat: never;
|
||||||
lastStartup: never;
|
lastStartup: never;
|
||||||
|
sendEditWarningShown: never;
|
||||||
|
formattingWarningShown: never;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type StorageInterface = {
|
export type StorageInterface = {
|
||||||
|
|
|
@ -20,7 +20,6 @@ export const STORAGE_UI_KEYS: ReadonlyArray<keyof StorageAccessType> = [
|
||||||
'customColors',
|
'customColors',
|
||||||
'defaultConversationColor',
|
'defaultConversationColor',
|
||||||
'existingOnboardingStoryMessageIds',
|
'existingOnboardingStoryMessageIds',
|
||||||
'formattingWarningShown',
|
|
||||||
'hasCompletedSafetyNumberOnboarding',
|
'hasCompletedSafetyNumberOnboarding',
|
||||||
'hasCompletedUsernameLinkOnboarding',
|
'hasCompletedUsernameLinkOnboarding',
|
||||||
'hide-menu-bar',
|
'hide-menu-bar',
|
||||||
|
@ -34,7 +33,6 @@ export const STORAGE_UI_KEYS: ReadonlyArray<keyof StorageAccessType> = [
|
||||||
'preferred-video-input-device',
|
'preferred-video-input-device',
|
||||||
'preferredLeftPaneWidth',
|
'preferredLeftPaneWidth',
|
||||||
'preferredReactionEmoji',
|
'preferredReactionEmoji',
|
||||||
'sendEditWarningShown',
|
|
||||||
'sent-media-quality',
|
'sent-media-quality',
|
||||||
'showStickerPickerHint',
|
'showStickerPickerHint',
|
||||||
'showStickersIntroduction',
|
'showStickersIntroduction',
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
// Copyright 2023 Signal Messenger, LLC
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
import { explodePromise } from './explodePromise';
|
|
||||||
|
|
||||||
export async function maybeBlockSendForEditWarningModal(): Promise<boolean> {
|
|
||||||
const explodedPromise = explodePromise<boolean>();
|
|
||||||
window.reduxActions.globalModals.showSendEditWarningModal(explodedPromise);
|
|
||||||
return explodedPromise.promise;
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
// Copyright 2022 Signal Messenger, LLC
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
import { explodePromise } from './explodePromise';
|
|
||||||
|
|
||||||
export async function maybeBlockSendForFormattingModal(): Promise<boolean> {
|
|
||||||
const explodedPromise = explodePromise<boolean>();
|
|
||||||
window.reduxActions.globalModals.showFormattingWarningModal(explodedPromise);
|
|
||||||
return explodedPromise.promise;
|
|
||||||
}
|
|
Loading…
Reference in a new issue