summaryrefslogtreecommitdiffstats
path: root/webapp/actions/channel_actions.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu97@outlook.com>2016-08-11 10:32:41 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-08-11 10:32:41 -0400
commitbb0b895bad5cddbc0297d0857d10a531a6ca6755 (patch)
tree3fa599d9a0a418deca030906b0793e92b09a0979 /webapp/actions/channel_actions.jsx
parent0cee02d4d3ca05e1e09a918f175c8e021743e992 (diff)
downloadchat-bb0b895bad5cddbc0297d0857d10a531a6ca6755.tar.gz
chat-bb0b895bad5cddbc0297d0857d10a531a6ca6755.tar.bz2
chat-bb0b895bad5cddbc0297d0857d10a531a6ca6755.zip
Removed /shortcuts from mobile (#3753)
Diffstat (limited to 'webapp/actions/channel_actions.jsx')
-rw-r--r--webapp/actions/channel_actions.jsx17
1 files changed, 11 insertions, 6 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index e8cd5aff0..c264fcb34 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -7,6 +7,7 @@ import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
+import * as UserAgent from 'utils/user_agent.jsx';
import Client from 'client/web_client.jsx';
export function goToChannel(channel) {
@@ -28,12 +29,16 @@ export function executeCommand(channelId, message, suggest, success, error) {
msg = msg.substring(0, msg.indexOf(' ')).toLowerCase() + msg.substring(msg.indexOf(' '), msg.length);
- if (message.indexOf('/shortcuts') !== -1 && Utils.isMac()) {
- msg += ' mac';
- }
-
- if (!Utils.isMac() && message.indexOf('/shortcuts') !== -1 && message.indexOf('mac') !== -1) {
- msg = '/shortcuts';
+ if (message.indexOf('/shortcuts') !== -1) {
+ if (UserAgent.isMobileApp()) {
+ const err = {message: Utils.localizeMessage('create_post.shortcutsNotSupported', 'Keyboard shortcuts are not supported on your device')};
+ error(err);
+ return;
+ } else if (Utils.isMac()) {
+ msg += ' mac';
+ } else if (message.indexOf('mac') !== -1) {
+ msg = '/shortcuts';
+ }
}
Client.executeCommand(channelId, msg, suggest, success, error);