chore: cleanup

This commit is contained in:
Nathan Walker
2020-07-09 23:43:28 -07:00
parent 0ae8dba962
commit 8100cf7089
89 changed files with 493 additions and 704 deletions

View File

@@ -55,9 +55,14 @@ function _getConnectionTypeFromFlags(flags: number): number {
return connectionType.mobile;
}
const cfDict = CFNetworkCopySystemProxySettings();
const nsDict = cfDict.takeUnretainedValue();
const keys = nsDict.objectForKey('__SCOPED__');
let keys: any;
if (typeof CFNetworkCopySystemProxySettings !== 'undefined') {
const cfDict = CFNetworkCopySystemProxySettings();
if (cfDict && cfDict.takeUnretainedValue) {
const nsDict = cfDict.takeUnretainedValue();
keys = nsDict.objectForKey('__SCOPED__');
}
}
if (isVPNConnected(keys)) {
return connectionType.vpn;