diff --git a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 index 3537ec1d975..367e6aa3048 100644 --- a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 +++ b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 @@ -68,6 +68,12 @@ export default { this.searchService = this.container.lookup('search-service:main'); this.appEvents = this.container.lookup('app-events:main'); this.currentUser = this.container.lookup('current-user:main'); + let siteSettings = this.container.lookup('site-settings:main'); + + // Disable the shortcut if private messages are disabled + if (!siteSettings.enable_private_messages) { + delete bindings['g m']; + } Object.keys(bindings).forEach(key => { const binding = bindings[key]; diff --git a/app/assets/javascripts/discourse/templates/modal/keyboard-shortcuts-help.hbs b/app/assets/javascripts/discourse/templates/modal/keyboard-shortcuts-help.hbs index c426e91d038..9dceda5cf87 100644 --- a/app/assets/javascripts/discourse/templates/modal/keyboard-shortcuts-help.hbs +++ b/app/assets/javascripts/discourse/templates/modal/keyboard-shortcuts-help.hbs @@ -11,7 +11,9 @@