From caad5b274b72b07377ba540cdee6ae938ba00ab2 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:42:57 +0600 Subject: [PATCH 1/2] [FSSDK-10730] isClientReady logic adjustment --- src/client.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index 280eeac..8491ff4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -240,7 +240,6 @@ class OptimizelyReactSDKClient implements ReactSDKClient { }); this._client = optimizely.createInstance(configWithClientInfo); - this.isClientReady = !!configWithClientInfo.datafile; this.isUsingSdkKey = !!configWithClientInfo.sdkKey; if (this._client) { @@ -251,7 +250,6 @@ class OptimizelyReactSDKClient implements ReactSDKClient { this.isClientReady = clientResult.success; this.isUserReady = userResult.success; const clientAndUserReady = this.isClientReady && this.isUserReady; - this.clientAndUserReadyPromiseFulfilled = true; return { From 906faf33111e4a00fc22cb8abb0dcdcedb09ffb6 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:22:26 +0600 Subject: [PATCH 2/2] [FSSDK-10730] isClientReady if config ready --- src/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 8491ff4..d073f9b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -240,6 +240,7 @@ class OptimizelyReactSDKClient implements ReactSDKClient { }); this._client = optimizely.createInstance(configWithClientInfo); + this.isClientReady = !!this.getOptimizelyConfig(); this.isUsingSdkKey = !!configWithClientInfo.sdkKey; if (this._client) { @@ -249,7 +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 {