@advertol/core
Advanced tools
Comparing version
@@ -5,2 +5,8 @@ # Changelog | ||
## [1.0.3][] - 2024-02-08 | ||
### Fixed | ||
- Check if control should be triggered for specific zone | ||
## [1.0.2][] - 2024-02-08 | ||
@@ -25,5 +31,6 @@ | ||
[Unreleased]: https://github.com/niksy/advertol-core/compare/v1.0.2...HEAD | ||
[Unreleased]: https://github.com/niksy/advertol-core/compare/v1.0.3...HEAD | ||
[1.0.3]: https://github.com/niksy/advertol-core/compare/v1.0.2...v1.0.3 | ||
[1.0.2]: https://github.com/niksy/advertol-core/compare/v1.0.1...v1.0.2 | ||
[1.0.1]: https://github.com/niksy/advertol-core/compare/v1.0.0...v1.0.1 | ||
[1.0.0]: https://github.com/niksy/advertol-core/tree/v1.0.0 |
@@ -411,2 +411,3 @@ 'use strict'; | ||
this.controls.forEach(function (control) { | ||
var shouldTriggerControlCache = control._shouldTriggerControlCache; | ||
var onInitialControlTriggerCache = control._onInitialControlTriggerCache; | ||
@@ -417,12 +418,18 @@ _this2.zones.forEach(function (_ref2) { | ||
isEmpty = _ref2.isEmpty; | ||
/* eslint-disable-next-line no-undefined */ | ||
var triggerPromise = Promise.resolve(onInitialControlTriggerCache[id] || undefined).then(function (initialControlTriggerResult) { | ||
control.destroy({ | ||
isEmpty: isEmpty, | ||
element: element, | ||
id: id, | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
/* eslint-disable no-undefined */ | ||
var triggerPromise = Promise.all([Promise.resolve(shouldTriggerControlCache[id] || false), Promise.resolve(onInitialControlTriggerCache[id] || undefined)]).then(function (_ref3) { | ||
var isControlTriggered = _ref3[0], | ||
initialControlTriggerResult = _ref3[1]; | ||
if (isControlTriggered) { | ||
control.destroy({ | ||
isEmpty: isEmpty, | ||
element: element, | ||
id: id, | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
} | ||
return; | ||
}); | ||
/* eslint-enable */ | ||
triggerPromises.push(triggerPromise); | ||
@@ -429,0 +436,0 @@ }); |
@@ -407,2 +407,3 @@ function _extends() { | ||
this.controls.forEach(function (control) { | ||
var shouldTriggerControlCache = control._shouldTriggerControlCache; | ||
var onInitialControlTriggerCache = control._onInitialControlTriggerCache; | ||
@@ -413,12 +414,18 @@ _this2.zones.forEach(function (_ref2) { | ||
isEmpty = _ref2.isEmpty; | ||
/* eslint-disable-next-line no-undefined */ | ||
var triggerPromise = Promise.resolve(onInitialControlTriggerCache[id] || undefined).then(function (initialControlTriggerResult) { | ||
control.destroy({ | ||
isEmpty: isEmpty, | ||
element: element, | ||
id: id, | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
/* eslint-disable no-undefined */ | ||
var triggerPromise = Promise.all([Promise.resolve(shouldTriggerControlCache[id] || false), Promise.resolve(onInitialControlTriggerCache[id] || undefined)]).then(function (_ref3) { | ||
var isControlTriggered = _ref3[0], | ||
initialControlTriggerResult = _ref3[1]; | ||
if (isControlTriggered) { | ||
control.destroy({ | ||
isEmpty: isEmpty, | ||
element: element, | ||
id: id, | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
} | ||
return; | ||
}); | ||
/* eslint-enable */ | ||
triggerPromises.push(triggerPromise); | ||
@@ -425,0 +432,0 @@ }); |
{ | ||
"name": "@advertol/core", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Advertisement zones manager.", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
106175
1.75%1272
0.95%