From 79682580040168f517454156476bcbc0bd36e28c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 22 Sep 2020 20:52:37 -0700 Subject: [PATCH] appease TS --- .../components/server/files/NewDirectoryButton.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/scripts/components/server/files/NewDirectoryButton.tsx b/resources/scripts/components/server/files/NewDirectoryButton.tsx index c8e39b22f..987fe0dad 100644 --- a/resources/scripts/components/server/files/NewDirectoryButton.tsx +++ b/resources/scripts/components/server/files/NewDirectoryButton.tsx @@ -45,11 +45,11 @@ export default ({ className }: WithClassname) => { const directory = ServerContext.useStoreState(state => state.files.directory); useEffect(() => { - if (visible) { - return () => { - clearFlashes('files:directory-modal'); - }; - } + if (!visible) return; + + return () => { + clearFlashes('files:directory-modal'); + }; }, [ visible ]); const submit = ({ directoryName }: Values, { setSubmitting }: FormikHelpers) => {