Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_onCompletion() {
let currentPercentage = this._metrics.extra.watchedPercentage
let allPercentages = this._completion.watch
let isCalled = this._completion.calls.indexOf(currentPercentage) != -1
if (allPercentages.indexOf(currentPercentage) != -1 && !isCalled) {
Log.info(this.name + ' PERCENTAGE_EVENT: ' + currentPercentage)
this._completion.calls.push(currentPercentage)
this.trigger(ClapprStats.PERCENTAGE_EVENT, currentPercentage)
}
}