fixes 'Video player out of whack after resize of window #3423' by adding event listeners prior to cleanup
This commit is contained in:
parent
c5c02f0ad9
commit
aa16c83f27
1 changed files with 3 additions and 3 deletions
|
@ -105,10 +105,10 @@ export default function FileViewer(props: Props) {
|
||||||
setFileViewerRect(rect);
|
setFileViewerRect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleResize();
|
||||||
|
window.addEventListener('resize', handleResize);
|
||||||
|
onFullscreenChange(window, 'add', handleResize);
|
||||||
return () => {
|
return () => {
|
||||||
handleResize();
|
|
||||||
window.addEventListener('resize', handleResize);
|
|
||||||
onFullscreenChange(window, 'add', handleResize);
|
|
||||||
window.removeEventListener('resize', handleResize);
|
window.removeEventListener('resize', handleResize);
|
||||||
onFullscreenChange(window, 'remove', handleResize);
|
onFullscreenChange(window, 'remove', handleResize);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue