only use our experimentPing outside of Test Pilot
This commit is contained in:
@@ -82,21 +82,14 @@ function experimentPing(event) {
|
||||
}
|
||||
|
||||
function Experiment() {
|
||||
Events.on(EVENT_SEND_METRIC, experimentPing);
|
||||
// If the user has @testpilot-addon, it already bound
|
||||
// experimentPing to testpilot::send-metric,
|
||||
// so we don't need to bind this one
|
||||
AddonManager.getAddonByID('@testpilot-addon', addon => {
|
||||
if (!addon) {
|
||||
Events.on(EVENT_SEND_METRIC, experimentPing);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Experiment.prototype = {
|
||||
constructor: function() {
|
||||
Events.on(EVENT_SEND_METRIC, experimentPing);
|
||||
},
|
||||
|
||||
ping: function(event) {
|
||||
experimentPing(event);
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
Events.off(EVENT_SEND_METRIC, experimentPing);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Experiment;
|
||||
|
||||
Reference in New Issue
Block a user