forked from Ivasoft/mattermost-mobile
MM-13337 Fix EMM connections using VPN on-demand (#2558)
* Fix EMM connections using VPN on-demand * Update package.json * Update package-lock.json
This commit is contained in:
committed by
Miguel Alatzar
parent
e5e741840e
commit
ffef7e2bcf
@@ -38,7 +38,15 @@ Client4.doFetchWithResponse = async (url, options) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const customHeaders = LocalConfig.CustomRequestHeaders;
|
const customHeaders = LocalConfig.CustomRequestHeaders;
|
||||||
let requestOptions = Client4.getOptions(options);
|
let waitsForConnectivity = false;
|
||||||
|
if (url.includes('/api/v4/system/ping')) {
|
||||||
|
waitsForConnectivity = true;
|
||||||
|
}
|
||||||
|
let requestOptions = {
|
||||||
|
...Client4.getOptions(options),
|
||||||
|
waitsForConnectivity,
|
||||||
|
};
|
||||||
|
|
||||||
if (customHeaders && Object.keys(customHeaders).length > 0) {
|
if (customHeaders && Object.keys(customHeaders).length > 0) {
|
||||||
requestOptions = {
|
requestOptions = {
|
||||||
...requestOptions,
|
...requestOptions,
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ export default class SelectServer extends PureComponent {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Client4.setUrl(url);
|
Client4.setUrl(url);
|
||||||
|
Client4.online = true;
|
||||||
handleServerUrlChanged(url);
|
handleServerUrlChanged(url);
|
||||||
|
|
||||||
let cancel = false;
|
let cancel = false;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export async function checkConnection(isConnected) {
|
|||||||
const config = {
|
const config = {
|
||||||
timeout: PING_TIMEOUT,
|
timeout: PING_TIMEOUT,
|
||||||
auto: true,
|
auto: true,
|
||||||
|
waitsForConnectivity: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Platform.OS === 'ios' && certificate === '') {
|
if (Platform.OS === 'ios' && certificate === '') {
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -12353,8 +12353,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rn-fetch-blob": {
|
"rn-fetch-blob": {
|
||||||
"version": "github:enahum/react-native-fetch-blob#20d1c07ef34ba18be485a1f56cd2261158e93f69",
|
"version": "github:enahum/react-native-fetch-blob#1f370ab3616101d4ffe919e0b58cbe4ef319ce5d",
|
||||||
"from": "github:enahum/react-native-fetch-blob#20d1c07ef34ba18be485a1f56cd2261158e93f69",
|
"from": "github:enahum/react-native-fetch-blob#1f370ab3616101d4ffe919e0b58cbe4ef319ce5d",
|
||||||
"requires": {
|
"requires": {
|
||||||
"base-64": "0.1.0",
|
"base-64": "0.1.0",
|
||||||
"glob": "7.0.6"
|
"glob": "7.0.6"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
"redux-persist-transform-filter": "0.0.18",
|
"redux-persist-transform-filter": "0.0.18",
|
||||||
"redux-thunk": "2.3.0",
|
"redux-thunk": "2.3.0",
|
||||||
"reselect": "4.0.0",
|
"reselect": "4.0.0",
|
||||||
"rn-fetch-blob": "github:enahum/react-native-fetch-blob#20d1c07ef34ba18be485a1f56cd2261158e93f69",
|
"rn-fetch-blob": "github:enahum/react-native-fetch-blob#1f370ab3616101d4ffe919e0b58cbe4ef319ce5d",
|
||||||
"rn-placeholder": "github:enahum/rn-placeholder#bfee66eb54f1f06d1425a0ad511a5e16559bf82c",
|
"rn-placeholder": "github:enahum/rn-placeholder#bfee66eb54f1f06d1425a0ad511a5e16559bf82c",
|
||||||
"semver": "5.6.0",
|
"semver": "5.6.0",
|
||||||
"shallow-equals": "1.0.0",
|
"shallow-equals": "1.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user