Support for sending formatting messages
This commit is contained in:
parent
42e13aedcd
commit
9bfbee464b
65 changed files with 1762 additions and 371 deletions
18
ts/util/maybeBlockSendForFormattingModal.ts
Normal file
18
ts/util/maybeBlockSendForFormattingModal.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { DraftBodyRanges } from '../types/BodyRange';
|
||||
import { BodyRange } from '../types/BodyRange';
|
||||
import { explodePromise } from './explodePromise';
|
||||
|
||||
export async function maybeBlockSendForFormattingModal(
|
||||
bodyRanges: DraftBodyRanges
|
||||
): Promise<boolean> {
|
||||
if (!bodyRanges.some(BodyRange.isFormatting)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const explodedPromise = explodePromise<boolean>();
|
||||
window.reduxActions.globalModals.showFormattingWarningModal(explodedPromise);
|
||||
return explodedPromise.promise;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue