Skip to content

Commit 566daaf

Browse files
author
Mike Chu
committed
fix: remove successful fetch requirement for onReady
1 parent 8e3b29a commit 566daaf

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/client.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,10 @@ class OptimizelyReactSDKClient implements ReactSDKClient {
290290
}, timeout) as any;
291291
});
292292

293-
return Promise.race([this.dataReadyPromise, timeoutPromise]).then(async res => {
293+
return Promise.race([this.dataReadyPromise, timeoutPromise]).then(res => {
294294
clearTimeout(timeoutId);
295295
if (res.success && !this.initialConfig.odpOptions?.disabled) {
296-
const isSegmentsFetched = await this.fetchQualifiedSegments();
297-
if (!isSegmentsFetched) {
298-
return {
299-
success: false,
300-
reason: 'USER_NOT_READY',
301-
message: 'Failed to fetch qualified segments',
302-
};
303-
}
296+
this.fetchQualifiedSegments();
304297
}
305298
return res;
306299
});

0 commit comments

Comments
 (0)