Skip to content

Commit

Permalink
remove code waiting forever for EventSub unsubscription confirmations
Browse files Browse the repository at this point in the history
  • Loading branch information
cactysman committed Feb 6, 2021
1 parent d6566af commit 2f00945
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions packages/twitch-eventsub/src/Subscriptions/EventSubSubscription.ts
Expand Up @@ -16,7 +16,6 @@ export type SubscriptionResultType<T extends EventSubSubscription> = T extends E
export abstract class EventSubSubscription</** @private */ T = any> {
private _verified: boolean = false;
private _twitchSubscriptionData?: HelixEventSubSubscription;
private _unsubscribeResolver?: () => void;

/** @private */
protected constructor(protected _handler: (obj: T) => void, protected _client: EventSubListener) {}
Expand Down Expand Up @@ -59,16 +58,6 @@ export abstract class EventSubSubscription</** @private */ T = any> {
this._handler(this.transformData(body));
}

/** @private */
_handleUnsubscribe(): boolean {
if (this._unsubscribeResolver) {
this._unsubscribeResolver();
this._unsubscribeResolver = undefined;
return true;
}
return false;
}

/**
* Activates the subscription.
*/
Expand All @@ -94,9 +83,7 @@ export abstract class EventSubSubscription</** @private */ T = any> {
if (!this._twitchSubscriptionData) {
return;
}
const unsubscribePromise = new Promise<void>(resolve => (this._unsubscribeResolver = resolve));
await this._unsubscribe();
await unsubscribePromise;
this._twitchSubscriptionData = undefined;
}

Expand Down

0 comments on commit 2f00945

Please sign in to comment.