Skip to content

Commit

Permalink
fix: Do not refresh all ads when new component loads (#8)
Browse files Browse the repository at this point in the history
Fixes an issue where all ad slots would reload when syncCorrelator was true and a new slot was added
  • Loading branch information
andrewb authored Jan 18, 2019
1 parent d6521a7 commit 9f143a8
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/Bling.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,22 +433,12 @@ class Bling extends Component {

if (shouldRefresh) {
this.configureSlot(this._adSlot, nextProps);
this.refresh();
return false;
}

if (Bling._adManager._syncCorrelator) {
if (shouldRefresh) {
Bling._adManager.refresh();
} else if (shouldRender || isScriptLoaded) {
Bling._adManager.renderAll();
}
} else {
if (shouldRefresh) {
this.refresh();
return false;
}
if (shouldRender || isScriptLoaded) {
return true;
}
if (shouldRender || isScriptLoaded) {
return true;
}

return false;
Expand Down

0 comments on commit 9f143a8

Please sign in to comment.