Skip to content

Commit

Permalink
Avoid generating MetaMetrics ID if it doens't already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt committed May 29, 2024
1 parent 78ec096 commit c90863b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class MetaMetricsDataDeletionController extends BaseController<
> {
#dataDeletionService: DataDeletionService;

#getMetaMetricsId: () => string;
#getMetaMetricsId: () => string | null;

/**
* Creates a MetaMetricsDataDeletionController instance.
Expand All @@ -124,7 +124,7 @@ export default class MetaMetricsDataDeletionController extends BaseController<
dataDeletionService: DataDeletionService;
messenger: MetaMetricsDataDeletionControllerMessenger;
state?: MetaMetricsDataDeletionState;
getMetaMetricsId: () => string;
getMetaMetricsId: () => string | null;
}) {
// Call the constructor of BaseControllerV2
super({
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,8 @@ export default class MetamaskController extends EventEmitter {
dataDeletionService,
messenger: metaMetricsDataDeletionMessenger,
state: initState.metaMetricsDataDeletionController,
getMetaMetricsId: () => this.metaMetricsController.getMetaMetricsId(),
getMetaMetricsId: () =>
this.metaMetricsController.store.getState().metaMetricsId,
});

const gasFeeMessenger = this.controllerMessenger.getRestricted({
Expand Down

0 comments on commit c90863b

Please sign in to comment.