Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timezone migration #2115

Merged
merged 2 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion src/libs/DateUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import moment from 'moment';
import 'moment-timezone';
import _ from 'underscore';
import Onyx from 'react-native-onyx';
import Str from 'expensify-common/lib/str';
import ONYXKEYS from '../ONYXKEYS';
Expand All @@ -8,7 +9,16 @@ import CONST from '../CONST';
let timezone;
Onyx.connect({
key: ONYXKEYS.MY_PERSONAL_DETAILS,
callback: (val) => { timezone = val ? val.timezone.selected : CONST.DEFAULT_TIME_ZONE.selected; },
callback: (val) => {
timezone = val ? val.timezone : CONST.DEFAULT_TIME_ZONE.selected;

// Make sure that if we have a timezone in object format that we're getting the selected timezone name
// Older timezone formats only include the timezone name, but the newer format also included whether or
// not the timezone was selected automatically
if (_.isObject(timezone)) {
timezone = val.timezone.selected;
}
},
});

/**
Expand Down
2 changes: 0 additions & 2 deletions src/libs/migrateOnyx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import RenameActiveClientsKey from './migrations/RenameActiveClientsKey';
import RenamePriorityModeKey from './migrations/RenamePriorityModeKey';
import ReformatTimezone from './migrations/ReformatTimezone';

export default function () {
const startTime = Date.now();
Expand All @@ -11,7 +10,6 @@ export default function () {
const migrationPromises = [
RenameActiveClientsKey,
RenamePriorityModeKey,
ReformatTimezone,
];

// Reduce all promises down to a single promise. All promises run in a linear fashion, waiting for the
Expand Down
41 changes: 0 additions & 41 deletions src/libs/migrations/ReformatTimezone.js

This file was deleted.