Disable keyboard shortcut for conversation archive
This commit is contained in:
parent
014716922f
commit
fca40cb548
2 changed files with 17 additions and 17 deletions
|
@ -1,5 +1,4 @@
|
||||||
/* global
|
/* global
|
||||||
$,
|
|
||||||
ConversationController,
|
ConversationController,
|
||||||
extension,
|
extension,
|
||||||
getConversations,
|
getConversations,
|
||||||
|
@ -8,6 +7,7 @@
|
||||||
Whisper,
|
Whisper,
|
||||||
textsecure,
|
textsecure,
|
||||||
Signal
|
Signal
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
// eslint-disable-next-line func-names
|
||||||
|
@ -150,23 +150,23 @@
|
||||||
// In the future this listener will be added by the conversation view itself. But
|
// In the future this listener will be added by the conversation view itself. But
|
||||||
// because we currently have multiple converations open at once, we install just
|
// because we currently have multiple converations open at once, we install just
|
||||||
// one global handler.
|
// one global handler.
|
||||||
$(document).on('keydown', event => {
|
// $(document).on('keydown', event => {
|
||||||
const { ctrlKey, key } = event;
|
// const { ctrlKey, key } = event;
|
||||||
|
|
||||||
// We can add Command-E as the Mac shortcut when we add it to our Electron menus:
|
// We can add Command-E as the Mac shortcut when we add it to our Electron menus:
|
||||||
// https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key
|
// https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key
|
||||||
// For now, it will stay as CTRL-E only
|
// For now, it will stay as CTRL-E only
|
||||||
if (key === 'e' && ctrlKey) {
|
// if (key === 'e' && ctrlKey) {
|
||||||
const state = this.store.getState();
|
// const state = this.store.getState();
|
||||||
const selectedId = state.conversations.selectedConversation;
|
// const selectedId = state.conversations.selectedConversation;
|
||||||
const conversation = ConversationController.get(selectedId);
|
// const conversation = ConversationController.get(selectedId);
|
||||||
|
|
||||||
if (conversation && !conversation.get('isArchived')) {
|
// if (conversation && !conversation.get('isArchived')) {
|
||||||
conversation.setArchived(true);
|
// conversation.setArchived(true);
|
||||||
conversation.trigger('unload');
|
// conversation.trigger('unload');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.listenTo(convoCollection, 'remove', conversation => {
|
this.listenTo(convoCollection, 'remove', conversation => {
|
||||||
const { id } = conversation || {};
|
const { id } = conversation || {};
|
||||||
|
|
|
@ -563,7 +563,7 @@
|
||||||
{
|
{
|
||||||
"rule": "jQuery-$(",
|
"rule": "jQuery-$(",
|
||||||
"path": "js/views/inbox_view.js",
|
"path": "js/views/inbox_view.js",
|
||||||
"line": " $(document).on('keydown', event => {",
|
"line": " // $(document).on('keydown', event => {",
|
||||||
"lineNumber": 153,
|
"lineNumber": 153,
|
||||||
"reasonCategory": "usageTrusted",
|
"reasonCategory": "usageTrusted",
|
||||||
"updated": "2019-04-03T00:43:09.315Z",
|
"updated": "2019-04-03T00:43:09.315Z",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue