From aa16c83f27cb41a57068ec77bb4f236c914b20f3 Mon Sep 17 00:00:00 2001 From: Dalton Date: Mon, 30 Dec 2019 21:09:20 -0600 Subject: [PATCH] fixes 'Video player out of whack after resize of window #3423' by adding event listeners prior to cleanup --- ui/component/fileViewer/view.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/component/fileViewer/view.jsx b/ui/component/fileViewer/view.jsx index eb0363ee9..0df34a06a 100644 --- a/ui/component/fileViewer/view.jsx +++ b/ui/component/fileViewer/view.jsx @@ -105,10 +105,10 @@ export default function FileViewer(props: Props) { setFileViewerRect(rect); } + handleResize(); + window.addEventListener('resize', handleResize); + onFullscreenChange(window, 'add', handleResize); return () => { - handleResize(); - window.addEventListener('resize', handleResize); - onFullscreenChange(window, 'add', handleResize); window.removeEventListener('resize', handleResize); onFullscreenChange(window, 'remove', handleResize); };