Skip to content

Commit

Permalink
Add missing method return types
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Feb 20, 2024
1 parent a955a1c commit 5c2e887
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/assets-controllers/src/TokenDetectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,43 +345,42 @@ export class TokenDetectionController extends StaticIntervalPollingController<
/**
* Allows controller to make active and passive polling requests
*/
enable() {
enable(): void {
this.#disabled = false;
}

/**
* Blocks controller from making network calls
*/
disable() {
disable(): void {
this.#disabled = true;
}

/**
* Internal isActive state
*
* @type {object}
* @type {boolean}
*/
get isActive() {
get isActive(): boolean {
return !this.#disabled && this.#isUnlocked;
}

/**
* Start polling for detected tokens.
*/
async start() {
async start(): Promise<void> {
this.enable();
await this.#startPolling();
}

/**
* Stop polling for detected tokens.
*/
stop() {
stop(): void {
this.disable();
this.#stopPolling();
}

#stopPolling() {
#stopPolling(): void {
if (this.#intervalId) {
clearInterval(this.#intervalId);
}
Expand Down Expand Up @@ -454,7 +453,7 @@ export class TokenDetectionController extends StaticIntervalPollingController<
async #restartTokenDetection({
selectedAddress,
networkClientId,
}: { selectedAddress?: string; networkClientId?: string } = {}) {
} = {}): Promise<void> {
await this.detectTokens({
networkClientId,
accountAddress: selectedAddress,
Expand Down

0 comments on commit 5c2e887

Please sign in to comment.