From d833f1558aa09bb20f2f434e57a462241e3868eb Mon Sep 17 00:00:00 2001 From: Morley Zhi <1668327+morleyzhi@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:01:15 -0400 Subject: [PATCH] Fix getUseIpAddressForGeolocation always returning true --- javascript/mixpanel-config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/javascript/mixpanel-config.js b/javascript/mixpanel-config.js index 37a83e90..47d075c2 100644 --- a/javascript/mixpanel-config.js +++ b/javascript/mixpanel-config.js @@ -4,7 +4,7 @@ import { defaultServerURL, } from "./mixpanel-constants"; -import {MixpanelLogger} from "./mixpanel-logger"; +import { MixpanelLogger } from "./mixpanel-logger"; export class MixpanelConfig { static instance; @@ -65,10 +65,14 @@ export class MixpanelConfig { } getUseIpAddressForGeolocation(token) { - return ( - (this._config[token] && this._config[token].useIpAddressForGeolocation) || - true - ); + if ( + this._config[token] && + "useIpAddressForGeolocation" in this._config[token] + ) { + return this._config[token].useIpAddressForGeolocation; + } + + return true; } setFlushBatchSize(token, batchSize) {