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] [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 {