Skip to content

Commit

Permalink
fix(engine-connector): fix ad error check (#274)
Browse files Browse the repository at this point in the history
Since ads error event return a pk error object, need to update according to pk error payload.
  • Loading branch information
Dan Ziv committed Sep 20, 2018
1 parent 6879b4f commit 452c69f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/engine-connector/engine-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class EngineConnector extends BaseComponent {
});

this.eventManager.listen(this.player, this.player.Event.AD_ERROR, e => {
if (e.payload.fatal) {
if (e.payload.severity === this.player.Error.Severity.CRITICAL) {
this.props.updateAdBreak(false);
}
});
Expand All @@ -199,7 +199,7 @@ class EngineConnector extends BaseComponent {
});

this.eventManager.listen(this.player, this.player.Event.ERROR, e => {
if (e.payload && e.payload.severity === 2) {
if (e.payload.severity === this.player.Error.Severity.CRITICAL) {
this.props.updateHasError(true);
}
});
Expand Down

0 comments on commit 452c69f

Please sign in to comment.