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/app/discussion/client/discussionFromMessageBox.js

35 lines
869 B

import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { messageBox, modal } from '../../ui-utils/client';
import { t } from '../../utils/client';
import { settings } from '../../settings/client';
Meteor.startup(function() {
Tracker.autorun(() => {
if (!settings.get('Discussion_enabled')) {
return messageBox.actions.remove('Create_new', /start-discussion/);
}
messageBox.actions.add('Create_new', 'Discussion', {
id: 'start-discussion',
icon: 'discussion',
condition: () => true,
action(data) {
modal.open({
title: t('Discussion_title'),
modifier: 'modal',
content: 'CreateDiscussion',
data: {
...data,
onCreate() {
modal.close();
},
},
showConfirmButton: false,
showCancelButton: false,
confirmOnEnter: false,
});
},
});
});
});