From 325626e46d9e755b1aa2b5a337525d89bb53a492 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 11 Jul 2020 16:49:46 -0700 Subject: [PATCH] Only render the modal when needed --- .../scripts/components/server/files/FileDropdownMenu.tsx | 5 ++++- resources/scripts/components/server/files/MassActionsBar.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/scripts/components/server/files/FileDropdownMenu.tsx b/resources/scripts/components/server/files/FileDropdownMenu.tsx index 0208d723f..e75f8e16b 100644 --- a/resources/scripts/components/server/files/FileDropdownMenu.tsx +++ b/resources/scripts/components/server/files/FileDropdownMenu.tsx @@ -116,12 +116,15 @@ export default ({ file }: { file: FileObject }) => { renderToggle={onClick => (
+ {!!modal && setModal(null)} /> + }
)} diff --git a/resources/scripts/components/server/files/MassActionsBar.tsx b/resources/scripts/components/server/files/MassActionsBar.tsx index 88524546b..6df43ecca 100644 --- a/resources/scripts/components/server/files/MassActionsBar.tsx +++ b/resources/scripts/components/server/files/MassActionsBar.tsx @@ -76,12 +76,15 @@ const MassActionsBar = () => { > Deleting files is a permanent operation, you cannot undo this action. + {showMove && setShowMove(false)} /> + }