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-apps/client/admin/appWhatIsIt.js

44 lines
934 B

import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Template } from 'meteor/templating';
Template.appWhatIsIt.onCreated(function() {
this.isLoading = new ReactiveVar(false);
this.hasError = new ReactiveVar(false);
});
Template.appWhatIsIt.helpers({
isLoading() {
if (Template.instance().isLoading) {
return Template.instance().isLoading.get();
}
return false;
},
hasError() {
if (Template.instance().hasError) {
return Template.instance().hasError.get();
}
return false;
},
});
Template.appWhatIsIt.events({
'click .js-enable'(e, t) {
t.isLoading.set(true);
Meteor.call('apps/go-enable', function _appsMightHaveBeenEnabled(error) {
if (error) {
t.hasError.set(true);
t.isLoading.set(false);
return;
}
window.Apps.load(true);
FlowRouter.go('/admin/apps');
});
},
});