Skip to content

Commit

Permalink
Ensure metrics adapters have owners to fix di (adopted-ember-addons#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
veelci committed Feb 16, 2023
1 parent 33e31a3 commit 3aea44f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/services/metrics.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Service from '@ember/service';
import { assert } from '@ember/debug';
import { dasherize } from '@ember/string';
import { getOwner } from '@ember/application';
import { getOwner, setOwner } from '@ember/application';

export default class Metrics extends Service {
/**
Expand Down Expand Up @@ -154,6 +154,7 @@ export default class Metrics extends Service {
*/
_activateAdapter({ adapterClass, config }) {
const adapter = new adapterClass(config);
setOwner(adapter, getOwner(this));
adapter.install();
return adapter;
}
Expand Down

0 comments on commit 3aea44f

Please sign in to comment.