Skip to content

Commit

Permalink
Disable keyboard shortcut for conversation archive
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Apr 17, 2019
1 parent 0147169 commit fca40cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions js/views/inbox_view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* global
$,
ConversationController,
extension,
getConversations,
Expand All @@ -8,6 +7,7 @@
Whisper,
textsecure,
Signal
*/

// eslint-disable-next-line func-names
Expand Down Expand Up @@ -150,23 +150,23 @@
// 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
// one global handler.
$(document).on('keydown', event => {
const { ctrlKey, key } = event;
// $(document).on('keydown', event => {
// const { ctrlKey, key } = event;

// 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
// For now, it will stay as CTRL-E only
if (key === 'e' && ctrlKey) {
const state = this.store.getState();
const selectedId = state.conversations.selectedConversation;
const conversation = ConversationController.get(selectedId);
// 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
// For now, it will stay as CTRL-E only
// if (key === 'e' && ctrlKey) {
// const state = this.store.getState();
// const selectedId = state.conversations.selectedConversation;
// const conversation = ConversationController.get(selectedId);

if (conversation && !conversation.get('isArchived')) {
conversation.setArchived(true);
conversation.trigger('unload');
}
}
});
// if (conversation && !conversation.get('isArchived')) {
// conversation.setArchived(true);
// conversation.trigger('unload');
// }
// }
// });

this.listenTo(convoCollection, 'remove', conversation => {
const { id } = conversation || {};
Expand Down
2 changes: 1 addition & 1 deletion ts/util/lint/exceptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@
{
"rule": "jQuery-$(",
"path": "js/views/inbox_view.js",
"line": " $(document).on('keydown', event => {",
"line": " // $(document).on('keydown', event => {",
"lineNumber": 153,
"reasonCategory": "usageTrusted",
"updated": "2019-04-03T00:43:09.315Z",
Expand Down

0 comments on commit fca40cb

Please sign in to comment.