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/userSetUtcOffset.js

14 lines
412 B

import moment from 'moment';
Meteor.startup(function() {
Tracker.autorun(function() {
[NEW] Setup Wizard (#10523) * welcome * . * stylelint * new ilustration * new layout * . * implements dicts * added all setup wizard settings to wizard * fix some setup wizard css * fix setup wizard js linter errors * remove old setup wizard templaates * setup wizard has just one main tag now * setup wizard registration fields filter is more readable * add register server page to setup wizard * fix setup wizard progress bar on RTL * setup wizard is registering users * Add setup wizard tests, routes and fix batch * fix setup wizard tests * add api test back * comment rocketchat:google-natural-language package and remove logs * add some translation keys for setup wizard * remove old setup wizard template * fix sort code on setup wizard * fix getWizardSetting method * new migration for setupwizard * setup wizard setting migration * fix setupwizard migration * Update versions * fix some setup wizard code logic * fix setup wizard registerServer setting * rever package-lock.json * rever google-natural-language .npm folder * rever meteor packages file and add setup wizard * remove some default values from setup wizard settings * add advocacy option on setup wizard industry setting * change key name to setting to make the filter more readable on setup wizard * change key name to setting to make the filter more readable on setup wizard * add findWizardSettings on models Settings and handle errors of getWizardSettings method * change setting to key to make the filter more readable on setup wizard * fix setup wizard settings filter map * remove serverHasAdminUser method on setup wizard * fix setup wizard tests * fix setup wizard final step workspace link * fix setup wizard tests
8 years ago
const user = RocketChat.models.Users.findOne({_id: Meteor.userId()}, {fields: {statusConnection: 1, utcOffset: 1}});
if (user && user.statusConnection === 'online') {
const utcOffset = moment().utcOffset() / 60;
if (user.utcOffset !== utcOffset) {
Meteor.call('userSetUtcOffset', utcOffset);
}
}
});
});