Skip to content

Commit

Permalink
Use networkClientId instead of chainId in #restartTokenDetection
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Jan 26, 2024
1 parent a8f3d05 commit e40e493
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/assets-controllers/src/TokenDetectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class TokenDetectionController extends StaticIntervalPollingController<
if (isChainIdChanged && this.#isDetectionEnabledForNetwork) {
this.#chainId = newChainId;
await this.#restartTokenDetection({
chainId: this.#chainId,
networkClientId: this.#networkClientId,
});
}
},
Expand Down Expand Up @@ -410,15 +410,15 @@ export class TokenDetectionController extends StaticIntervalPollingController<
*
* @param options - Options for restart token detection.
* @param options.selectedAddress - the selectedAddress against which to detect for token balances
* @param options.chainId - the chainId against which to detect for token balances
* @param options.networkClientId - The ID of the network client to use.
*/
async #restartTokenDetection({
selectedAddress,
chainId,
}: Partial<{ selectedAddress: string; chainId: Hex }> = {}) {
networkClientId,
}: { selectedAddress?: string; networkClientId?: string } = {}) {
await this.detectTokens({
networkClientId,
accountAddress: selectedAddress,
networkClientId: chainId,
});
this.setIntervalLength(DEFAULT_INTERVAL);
}
Expand Down

0 comments on commit e40e493

Please sign in to comment.