File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -245,17 +245,17 @@ class BrowserClientImpl extends LDClientImpl {
245245 // by the time the promise was rejected, then that would result in an unhandled promise
246246 // rejection.
247247
248+ // If initialization has already completed (successfully or failed), return the result immediately
249+ if ( this . _initializeResult ) {
250+ return Promise . resolve ( this . _initializeResult ) ;
251+ }
252+
248253 // It waitForInitialization was previously called, then we can use that promise even if it has
249254 // been resolved or rejected.
250255 if ( this . _initializedPromise ) {
251256 return this . _promiseWithTimeout ( this . _initializedPromise , timeout ) ;
252257 }
253258
254- // If initialization has already completed (successfully or failed), return the result immediately
255- if ( this . _initializeResult ) {
256- return Promise . resolve ( this . _initializeResult ) ;
257- }
258-
259259 if ( ! this . _initializedPromise ) {
260260 this . _initializedPromise = new Promise ( ( resolve ) => {
261261 this . _initResolve = resolve ;
You can’t perform that action at this time.
0 commit comments