Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions static/app/stores/configStore.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/react';
import moment from 'moment-timezone';
import {createStore} from 'reflux';

Expand All @@ -12,8 +11,6 @@ interface ConfigStoreDefinition extends StrictStoreDefinition<Config> {
set<K extends keyof Config>(key: K, value: Config[K]): void;
}

const {warn} = Sentry.logger;

const storeConfig: ConfigStoreDefinition = {
// When the app is booted we will _immediately_ hydrate the config store,
// effecively ensuring this is not empty.
Expand Down Expand Up @@ -47,21 +44,7 @@ const storeConfig: ConfigStoreDefinition = {
// TODO(dcramer): abstract this out of ConfigStore
if (this.state.user) {
this.state.user.permissions = new Set(this.state.user.permissions);

const systemTimeZone = moment.tz.guess();
const userTimeZone = this.state.user.options.timezone;

const nowInSystemTimezone = moment.tz(undefined, systemTimeZone);
const nowInUserTimezone = moment.tz(undefined, userTimeZone);

if (nowInSystemTimezone.utcOffset() !== nowInUserTimezone.utcOffset()) {
warn('System time zone does not match user preferences time zone', {
systemTimeZone,
userTimeZone,
});
}

moment.tz.setDefault(userTimeZone);
moment.tz.setDefault(this.state.user.options.timezone);
}

this.trigger(this.state);
Expand Down
Loading