mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-19 16:08:34 +01:00
Disable pasting in composer when in background
This commit is contained in:
@@ -105,6 +105,7 @@ export type Props = Readonly<{
|
||||
large: boolean | null;
|
||||
inputApi: React.MutableRefObject<InputApi | undefined> | null;
|
||||
isFormattingEnabled: boolean;
|
||||
isActive: boolean;
|
||||
sendCounter: number;
|
||||
skinTone: NonNullable<EmojiPickDataType['skinTone']> | null;
|
||||
draftText: string | null;
|
||||
@@ -158,6 +159,7 @@ export function CompositionInput(props: Props): React.ReactElement {
|
||||
i18n,
|
||||
inputApi,
|
||||
isFormattingEnabled,
|
||||
isActive,
|
||||
large,
|
||||
linkPreviewLoading,
|
||||
linkPreviewResult,
|
||||
@@ -409,9 +411,14 @@ export function CompositionInput(props: Props): React.ReactElement {
|
||||
isMouseDown,
|
||||
previousFormattingEnabled,
|
||||
previousIsMouseDown,
|
||||
quillRef,
|
||||
]);
|
||||
|
||||
React.useEffect(() => {
|
||||
quillRef.current?.getModule('signalClipboard').updateOptions({
|
||||
isDisabled: !isActive,
|
||||
});
|
||||
}, [isActive]);
|
||||
|
||||
const onEnter = (): boolean => {
|
||||
const quill = quillRef.current;
|
||||
const emojiCompletion = emojiCompletionRef.current;
|
||||
@@ -702,7 +709,9 @@ export function CompositionInput(props: Props): React.ReactElement {
|
||||
defaultValue={delta}
|
||||
modules={{
|
||||
toolbar: false,
|
||||
signalClipboard: true,
|
||||
signalClipboard: {
|
||||
isDisabled: !isActive,
|
||||
},
|
||||
clipboard: {
|
||||
matchers: [
|
||||
['IMG', matchEmojiImage],
|
||||
|
||||
Reference in New Issue
Block a user