Skip to content

Commit f3185b7

Browse files
[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.
1 parent 1197fb2 commit f3185b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/client.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class OptimizelyReactSDKClient implements ReactSDKClient {
240240
});
241241

242242
this._client = optimizely.createInstance(configWithClientInfo);
243-
this.isClientReady = !!configWithClientInfo.datafile;
243+
this.isClientReady = !!this.getOptimizelyConfig();
244244
this.isUsingSdkKey = !!configWithClientInfo.sdkKey;
245245

246246
if (this._client) {
@@ -250,8 +250,7 @@ class OptimizelyReactSDKClient implements ReactSDKClient {
250250
([userResult, clientResult]) => {
251251
this.isClientReady = clientResult.success;
252252
this.isUserReady = userResult.success;
253-
const clientAndUserReady = this.isClientReady && this.isUserReady;
254-
253+
const clientAndUserReady = this.isReady();
255254
this.clientAndUserReadyPromiseFulfilled = true;
256255

257256
return {

0 commit comments

Comments
 (0)