Skip to content

Commit

Permalink
fix(FEC-10782): spinner is shown while Imadai live ad (#565)
Browse files Browse the repository at this point in the history
In IMA DAI it is first changing to live preset and then to the ad preset causing the forward and backward button to unmount.
Due to changes in:
feat(FEC-10527): add RW/FF controls to live preset

These buttons in non dvr live return undefined in the render so we need to wrap withAnimation with relevant protection in all places. In the original ticket it was protected only in the didMount
  • Loading branch information
RoyBregman committed Dec 9, 2020
1 parent 43a878c commit 50f19ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/with-animation.js
Expand Up @@ -30,6 +30,7 @@ export const withAnimation: Function = (cssClass: string) => (WrappedComponent:
* @memberof AnimationComponent
*/
componentWillUnmount(): void {
if (!this.ref.current) return;
this.ref.current.classList.remove(cssClass);
}

Expand All @@ -39,6 +40,7 @@ export const withAnimation: Function = (cssClass: string) => (WrappedComponent:
* @memberof AnimationComponent
*/
animate(): void {
if (!this.ref.current) return;
this.ref.current.classList.add(cssClass);
}

Expand Down

0 comments on commit 50f19ca

Please sign in to comment.