Skip to content

Commit 0b1a1d0

Browse files
authored
Fix getUseIpAddressForGeolocation always returning true (#316)
1 parent 972f4bf commit 0b1a1d0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

javascript/mixpanel-config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
defaultServerURL,
55
} from "./mixpanel-constants";
66

7-
import {MixpanelLogger} from "./mixpanel-logger";
7+
import { MixpanelLogger } from "./mixpanel-logger";
88

99
export class MixpanelConfig {
1010
static instance;
@@ -65,10 +65,14 @@ export class MixpanelConfig {
6565
}
6666

6767
getUseIpAddressForGeolocation(token) {
68-
return (
69-
(this._config[token] && this._config[token].useIpAddressForGeolocation) ||
70-
true
71-
);
68+
if (
69+
this._config[token] &&
70+
"useIpAddressForGeolocation" in this._config[token]
71+
) {
72+
return this._config[token].useIpAddressForGeolocation;
73+
}
74+
75+
return true;
7276
}
7377

7478
setFlushBatchSize(token, batchSize) {

0 commit comments

Comments
 (0)