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/client/startup/setupWizard.ts

20 lines
620 B

import { FlowRouter } from 'meteor/kadira:flow-router';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { hasRole } from '../../app/authorization/client';
import { settings } from '../../app/settings/client';
Meteor.startup(() => {
Tracker.autorun(() => {
const userId = Meteor.userId();
const setupWizardState = settings.get('Show_Setup_Wizard');
const mustRedirect =
(!userId && setupWizardState === 'pending') || (!!userId && !!hasRole(userId, 'admin') && setupWizardState === 'in_progress');
if (mustRedirect) {
FlowRouter.go('setup-wizard');
}
});
});