From f3185b741148fc204891d05563b814002f496416 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:17:01 +0600 Subject: [PATCH] [FSSDK-10730] isClientReady logic adjustment (#285) React SDK sets client.isClientReady property to true immediately if datafile presents in the config, before projectConfigManager gets ready, which should not be the case. --- src/client.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index 280eeac..d073f9b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -240,7 +240,7 @@ class OptimizelyReactSDKClient implements ReactSDKClient { }); this._client = optimizely.createInstance(configWithClientInfo); - this.isClientReady = !!configWithClientInfo.datafile; + this.isClientReady = !!this.getOptimizelyConfig(); this.isUsingSdkKey = !!configWithClientInfo.sdkKey; if (this._client) { @@ -250,8 +250,7 @@ class OptimizelyReactSDKClient implements ReactSDKClient { ([userResult, clientResult]) => { this.isClientReady = clientResult.success; this.isUserReady = userResult.success; - const clientAndUserReady = this.isClientReady && this.isUserReady; - + const clientAndUserReady = this.isReady(); this.clientAndUserReadyPromiseFulfilled = true; return {