Skip to content

Commit e2e8971

Browse files
authored
fix: Client cannot become un-initialized. (#251)
1 parent 71c3afb commit e2e8971

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/shared/sdk-server/src/LDClientImpl.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,11 @@ export default class LDClientImpl implements LDClient {
214214

215215
this.onError(error);
216216
this.onFailed(error);
217-
this.initReject?.(error);
218-
this.initState = InitState.Failed;
217+
218+
if (!this.initialized()) {
219+
this.initState = InitState.Failed;
220+
this.initReject?.(error);
221+
}
219222
} else if (!this.initialized()) {
220223
this.initState = InitState.Initialized;
221224
this.initResolve?.(this);

0 commit comments

Comments
 (0)