diff --git a/main.js b/main.js index 41cf806ef..5b76a3315 100644 --- a/main.js +++ b/main.js @@ -605,12 +605,6 @@ ipc.on('show-window', () => { showWindow(); }); -ipc.on('set-secure-input', (_sender, enabled) => { - if (app.setSecureKeyboardEntryEnabled) { - app.setSecureKeyboardEntryEnabled(enabled); - } -}); - ipc.on('title-bar-double-click', () => { if (!mainWindow) { return; diff --git a/preload.js b/preload.js index 120836956..0867a14f4 100644 --- a/preload.js +++ b/preload.js @@ -142,9 +142,6 @@ try { window.log.info('show window'); ipc.send('show-window'); }; - window.setSecureInput = enabled => { - ipc.send('set-secure-input', enabled); - }; window.titleBarDoubleClick = () => { ipc.send('title-bar-double-click'); diff --git a/ts/components/CompositionArea.stories.tsx b/ts/components/CompositionArea.stories.tsx index 345c7d6e5..5baf4f8d1 100644 --- a/ts/components/CompositionArea.stories.tsx +++ b/ts/components/CompositionArea.stories.tsx @@ -40,7 +40,6 @@ const createProps = (overrideProps: Partial = {}): Props => ({ clearQuotedMessage: action('clearQuotedMessage'), getQuotedMessage: action('getQuotedMessage'), sortedGroupMembers: [], - setSecureInput: action('setSecureInput'), // EmojiButton onPickEmoji: action('onPickEmoji'), onSetSkinTone: action('onSetSkinTone'), diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 1c4c24655..8f9c23f3e 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -70,7 +70,6 @@ export type Props = Pick< | 'draftBodyRanges' | 'clearQuotedMessage' | 'getQuotedMessage' - | 'setSecureInput' > & Pick< EmojiButtonProps, @@ -117,7 +116,6 @@ export const CompositionArea = ({ clearQuotedMessage, getQuotedMessage, sortedGroupMembers, - setSecureInput, // EmojiButton onPickEmoji, onSetSkinTone, @@ -508,7 +506,6 @@ export const CompositionArea = ({ clearQuotedMessage={clearQuotedMessage} getQuotedMessage={getQuotedMessage} sortedGroupMembers={sortedGroupMembers} - setSecureInput={setSecureInput} /> {!large ? ( diff --git a/ts/components/CompositionInput.stories.tsx b/ts/components/CompositionInput.stories.tsx index 430865653..6b3585a93 100644 --- a/ts/components/CompositionInput.stories.tsx +++ b/ts/components/CompositionInput.stories.tsx @@ -29,7 +29,6 @@ const createProps = (overrideProps: Partial = {}): Props => ({ getQuotedMessage: action('getQuotedMessage'), onPickEmoji: action('onPickEmoji'), large: boolean('large', overrideProps.large || false), - setSecureInput: action('setSecureInput'), sortedGroupMembers: overrideProps.sortedGroupMembers || [], skinTone: select( 'skinTone', diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index 050f2ba81..cab654002 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -77,7 +77,6 @@ export type Props = { onSubmit(message: string, mentions: Array): unknown; getQuotedMessage(): unknown; clearQuotedMessage(): unknown; - setSecureInput(enabled: boolean): unknown; }; const MAX_LENGTH = 64 * 1024; @@ -95,7 +94,6 @@ export const CompositionInput: React.ComponentType = props => { skinTone, draftText, draftBodyRanges, - setSecureInput, getQuotedMessage, clearQuotedMessage, sortedGroupMembers, @@ -252,20 +250,6 @@ export const CompositionInput: React.ComponentType = props => { return false; }; - const onFocus = (): void => { - setSecureInput(true); - }; - - const onBlur = (): void => { - setSecureInput(false); - }; - - React.useEffect(() => { - return () => { - setSecureInput(false); - }; - }, [setSecureInput]); - const onEnter = (): boolean => { const quill = quillRef.current; const emojiCompletion = emojiCompletionRef.current; @@ -501,8 +485,6 @@ export const CompositionInput: React.ComponentType = props => { onChange, onEnter, onEscape, - onFocus, - onBlur, onPickEmoji, onShortKeyEnter, onTab, @@ -517,8 +499,6 @@ export const CompositionInput: React.ComponentType = props => { return ( callbacksRef.current.onFocus()} - onBlur={() => callbacksRef.current.onBlur()} onChange={() => callbacksRef.current.onChange()} defaultValue={delta} modules={{ diff --git a/ts/components/ForwardMessageModal.stories.tsx b/ts/components/ForwardMessageModal.stories.tsx index cb0f2902a..f9e78bf42 100644 --- a/ts/components/ForwardMessageModal.stories.tsx +++ b/ts/components/ForwardMessageModal.stories.tsx @@ -53,7 +53,6 @@ const createProps = (overrideProps: Partial = {}): PropsType => ({ onSetSkinTone: action('onSetSkinTone'), recentEmojis: [], removeLinkPreview: action('removeLinkPreview'), - setSecureInput: action('setSecureInput'), skinTone: 0, }); diff --git a/ts/components/ForwardMessageModal.tsx b/ts/components/ForwardMessageModal.tsx index 8cbe9e97a..c8cc83cfc 100644 --- a/ts/components/ForwardMessageModal.tsx +++ b/ts/components/ForwardMessageModal.tsx @@ -50,7 +50,6 @@ export type DataPropsType = { caretLocation?: number ) => unknown; onTextTooLong: () => void; - setSecureInput: (enabled: boolean) => void; } & Pick; type ActionPropsType = Pick< @@ -80,7 +79,6 @@ export const ForwardMessageModal: FunctionComponent = ({ recentEmojis, removeLinkPreview, skinTone, - setSecureInput, }) => { const inputRef = useRef(null); const inputApiRef = React.useRef(); @@ -309,7 +307,6 @@ export const ForwardMessageModal: FunctionComponent = ({ onPickEmoji={onPickEmoji} onSubmit={forwardMessage} onTextTooLong={onTextTooLong} - setSecureInput={setSecureInput} />
unknown; onTextTooLong: () => void; - setSecureInput: (enabled: boolean) => void; }; const mapStateToProps = ( @@ -49,7 +48,6 @@ const mapStateToProps = ( onClose, onEditorStateChange, onTextTooLong, - setSecureInput, } = props; const candidateConversations = getAllComposableConversations(state); @@ -70,7 +68,6 @@ const mapStateToProps = ( recentEmojis, skinTone, onTextTooLong, - setSecureInput, }; }; diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index d4d8b1f96..d7b80f6d6 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -620,9 +620,6 @@ Whisper.ConversationView = Whisper.View.extend({ bodyRanges: Array, caretLocation?: number ) => this.onEditorStateChange(msg, bodyRanges, caretLocation), - setSecureInput: (enabled: boolean) => { - window.setSecureInput(enabled); - }, onTextTooLong: () => this.showToast(Whisper.MessageBodyTooLongToast), onChooseAttachment: this.onChooseAttachment.bind(this), getQuotedMessage: () => this.model.get('quotedMessageId'), @@ -2252,9 +2249,6 @@ Whisper.ConversationView = Whisper.View.extend({ {}, document.querySelector('.module-ForwardMessageModal') ), - setSecureInput: (enabled: boolean) => { - window.setSecureInput(enabled); - }, } ), }); diff --git a/ts/window.d.ts b/ts/window.d.ts index 58efd9389..9386b0e3f 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -239,7 +239,6 @@ declare global { setAutoHideMenuBar: (value: WhatIsThis) => void; setBadgeCount: (count: number) => void; setMenuBarVisibility: (value: WhatIsThis) => void; - setSecureInput: (enabled: boolean) => void; showConfirmationDialog: (options: ConfirmationDialogViewProps) => void; showKeyboardShortcuts: () => void; storage: {