Skip to content

Commit bcc87ed

Browse files
committed
make it a bit more clear
1 parent 7005b5c commit bcc87ed

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/posthog-featureflags.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,12 @@ export class PostHogFeatureFlags {
391391
data.disable_flags = true
392392
}
393393

394+
const eligibleForFlagsV2 = token === DEFAULT_POSTHOG_APP_API_KEY && this.instance.config.__preview_remote_config
395+
394396
this._requestInFlight = true
395397
this.instance._send_request({
396398
method: 'POST',
397-
url: this.instance.requestRouter.endpointFor(
398-
'api',
399-
token === DEFAULT_POSTHOG_APP_API_KEY ? '/flags/?v=2' : '/decide/?v=4'
400-
),
399+
url: this.instance.requestRouter.endpointFor('api', eligibleForFlagsV2 ? '/flags/?v=2' : '/decide/?v=4'),
401400
data,
402401
compression: this.instance.config.disable_compression ? undefined : Compression.Base64,
403402
timeout: this.instance.config.feature_flag_request_timeout_ms,

0 commit comments

Comments
 (0)