From 084663460fa32b72ceded715ff67675881fc2926 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Fri, 22 Sep 2023 14:11:04 +0000 Subject: [PATCH] PR review change --- src/client.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index 3770c62..15dd300 100644 --- a/src/client.ts +++ b/src/client.ts @@ -243,12 +243,14 @@ class OptimizelyReactSDKClient implements ReactSDKClient { this.isClientReady = true; }); - this.dataReadyPromise = Promise.all([this.userPromise, this._client?.onReady()]).then(() => { - // Client and user can become ready synchronously and/or asynchronously. This flag specifically indicates that they became ready asynchronously. + this.dataReadyPromise = Promise.all([this.userPromise, this._client?.onReady()]).then(([userRes, clientRes]) => { + const bothReady = userRes.success && clientRes.success; this.isReadyPromiseFulfilled = true; return { - success: true, - message: 'Successfully resolved datafile and user information.', + success: bothReady, + message: bothReady + ? 'Successfully resolved user information and client datafile.' + : 'User information or client datafile was not not ready.', }; }); } else {