From 6c28ffaa18adf7251ccaf2456451adefadf08245 Mon Sep 17 00:00:00 2001 From: JT Turner Date: Fri, 1 May 2020 09:41:32 -0700 Subject: [PATCH] Fix loop when value really doesn't need to be global. --- ui/component/fileRenderFloating/view.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/component/fileRenderFloating/view.jsx b/ui/component/fileRenderFloating/view.jsx index 8dba004b7..f0471bf72 100644 --- a/ui/component/fileRenderFloating/view.jsx +++ b/ui/component/fileRenderFloating/view.jsx @@ -1,7 +1,7 @@ // @flow import * as ICONS from 'constants/icons'; import * as RENDER_MODES from 'constants/file_render_modes'; -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import Button from 'component/button'; import classnames from 'classnames'; import LoadingScreen from 'component/common/loading-screen'; @@ -39,7 +39,7 @@ export default function FileRenderFloating(props: Props) { setPlayingUri, } = props; const isMobile = useIsMobile(); - const [fileViewerRect, setFileViewerRect] = usePersistedState('inline-file-viewer:rect'); + const [fileViewerRect, setFileViewerRect] = useState(); const [position, setPosition] = usePersistedState('floating-file-viewer:position', { x: -25, y: window.innerHeight - 400, @@ -60,7 +60,7 @@ export default function FileRenderFloating(props: Props) { } const rect = element.getBoundingClientRect(); - // @FlowFixMe + // $FlowFixMe setFileViewerRect(rect); }