Skip to content

Commit 3c2e8f4

Browse files
remove hasAborted flag
1 parent a87059a commit 3c2e8f4

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/sdkBase.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export abstract class SdkBase {
5555
private _opts: SdkOptions = {};
5656
private _identity: Identity | OptoutIdentity | null | undefined;
5757
private _initComplete = false;
58-
private _hasAborted = false;
5958

6059
// Sets up nearly everything, but does not run SdkLoaded callbacks - derived classes must run them.
6160
protected constructor(existingCallbacks: CallbackHandler[] | undefined, product: ProductDetails) {
@@ -176,7 +175,6 @@ export abstract class SdkBase {
176175

177176
// Note: This doesn't invoke callbacks. It's a hard, silent reset.
178177
public abort(reason?: string) {
179-
this._hasAborted = true;
180178
this._tokenPromiseHandler.rejectAllPromises(
181179
reason ?? new Error(`${this._product.name} SDK aborted.`)
182180
);
@@ -191,10 +189,6 @@ export abstract class SdkBase {
191189
if (!isSDKOptionsOrThrow(opts))
192190
throw new TypeError(`Options provided to ${this._product.name} init couldn't be validated.`);
193191

194-
if (this._hasAborted) {
195-
throw new TypeError('Calling init() once aborted or disconnected is not allowed');
196-
}
197-
198192
if (this.isInitComplete()) {
199193
const previousOpts = { ...this._opts };
200194
Object.assign(this._opts, opts);

0 commit comments

Comments
 (0)