Skip to content

Commit

Permalink
Fix TypeScript error about function declaration inside block
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Mar 22, 2022
1 parent 67f8d91 commit 0e1baa7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compat/event_listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,17 @@ function getVideoWidthRef(
} else if (!isNullOrUndefined(pipStatus.pipWindow)) {
const { pipWindow } = pipStatus;
const firstWidth = getVideoWidthFromPIPWindow(mediaElement, pipWindow);
const onPipResize = () => {
ref.setValueIfChanged(
getVideoWidthFromPIPWindow(mediaElement, pipWindow) * pixelRatio
);
};
pipWindow.addEventListener("resize", onPipResize);
clearPreviousEventListener = () => {
pipWindow.removeEventListener("resize", onPipResize);
clearPreviousEventListener = noop;
};
ref.setValueIfChanged(firstWidth * pixelRatio);
function onPipResize() {
ref.setValueIfChanged(
getVideoWidthFromPIPWindow(mediaElement, pipWindow) * pixelRatio
);
}
} else {
ref.setValueIfChanged(Infinity);
}
Expand Down

0 comments on commit 0e1baa7

Please sign in to comment.