The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/packages/rocketchat-lib/client/lib/startup/commands.js

18 lines
442 B

//Track logins and when they login, get the commands
(() => {
let oldUserId = null;
Meteor.autorun(() => {
const newUserId = Meteor.userId();
if (oldUserId === null && newUserId) {
RocketChat.API.v1.get('commands.list').then(function _loadedCommands(result) {
result.commands.forEach((command) => {
RocketChat.slashCommands.commands[command.command] = command;
});
});
}
oldUserId = Meteor.userId();
});
})();