MM-13795 Detect timezone updates on Android (#2660)

This commit is contained in:
Elias Nahum 2019-03-19 22:10:45 -03:00 committed by Miguel Alatzar
parent dbe5eba108
commit e053219fb0
3 changed files with 18 additions and 44 deletions

View file

@ -3,8 +3,6 @@
import DeviceInfo from 'react-native-device-info';
import {isMinimumServerVersion} from 'mattermost-redux/utils/helpers';
import moment from 'moment-timezone';
export function getDeviceTimezone() {
@ -21,6 +19,5 @@ export function getUtcOffsetForTimeZone(timezone) {
export function isTimezoneEnabled(state) {
const {config} = state.entities.general;
const serverVersion = state.entities.general.serverVersion;
return config.ExperimentalTimezone === 'true' && isMinimumServerVersion(serverVersion, 4, 9);
return config.ExperimentalTimezone === 'true';
}

55
package-lock.json generated
View file

@ -2688,7 +2688,6 @@
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"optional": true,
"requires": {
"is-extendable": "^0.1.0"
}
@ -2733,8 +2732,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
"dev": true,
"optional": true
"dev": true
},
"is-glob": {
"version": "4.0.0",
@ -4361,8 +4359,7 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"aproba": {
"version": "1.2.0",
@ -4380,13 +4377,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4399,18 +4394,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
@ -4513,8 +4505,7 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
@ -4524,7 +4515,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4537,20 +4527,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -4567,7 +4554,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4640,8 +4626,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
@ -4651,7 +4636,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4727,8 +4711,7 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"optional": true
"bundled": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4758,7 +4741,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4776,7 +4758,6 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -4815,13 +4796,11 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"optional": true
"bundled": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"optional": true
"bundled": true
}
}
},
@ -11937,8 +11916,8 @@
}
},
"react-native-device-info": {
"version": "github:enahum/react-native-device-info#d80037dd7d805bf9e7372aeef098d17c90e75e13",
"from": "github:enahum/react-native-device-info#d80037dd7d805bf9e7372aeef098d17c90e75e13"
"version": "github:enahum/react-native-device-info#00c9ff7dc11e63b06e0624cc1c4b0cc2bc4e7a39",
"from": "github:enahum/react-native-device-info#00c9ff7dc11e63b06e0624cc1c4b0cc2bc4e7a39"
},
"react-native-doc-viewer": {
"version": "2.7.8",
@ -12359,8 +12338,7 @@
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true,
"optional": true
"dev": true
},
"braces": {
"version": "2.3.2",
@ -12646,8 +12624,7 @@
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
"integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
"dev": true,
"optional": true
"dev": true
},
"micromatch": {
"version": "3.1.10",

View file

@ -31,7 +31,7 @@
"react-native-calendars": "github:enahum/react-native-calendars#e399bb749c0a944f009e75e7b45748299aea35d6",
"react-native-circular-progress": "1.1.0",
"react-native-cookies": "github:joeferraro/react-native-cookies#f11374745deba9f18f7b8a9bb4b0b2573026f522",
"react-native-device-info": "github:enahum/react-native-device-info#d80037dd7d805bf9e7372aeef098d17c90e75e13",
"react-native-device-info": "github:enahum/react-native-device-info#00c9ff7dc11e63b06e0624cc1c4b0cc2bc4e7a39",
"react-native-doc-viewer": "2.7.8",
"react-native-document-picker": "2.2.0",
"react-native-exception-handler": "2.10.6",