From 0834e1fa5819bb124ebc0033941ec3f638710c06 Mon Sep 17 00:00:00 2001 From: cballevre Date: Thu, 31 Aug 2023 12:08:06 +0200 Subject: [PATCH] fix(MoveModal): Remove some proptypes errors --- src/drive/web/modules/filelist/File.jsx | 2 +- src/drive/web/modules/move/FileList.jsx | 5 ++--- src/drive/web/modules/move/Topbar.jsx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/drive/web/modules/filelist/File.jsx b/src/drive/web/modules/filelist/File.jsx index 629e5b0e26..5dcb94c164 100644 --- a/src/drive/web/modules/filelist/File.jsx +++ b/src/drive/web/modules/filelist/File.jsx @@ -202,7 +202,7 @@ File.propTypes = { t: PropTypes.func, f: PropTypes.func, attributes: PropTypes.object.isRequired, - actions: PropTypes.array.isRequired, + actions: PropTypes.array, isRenaming: PropTypes.bool, withSelectionCheckbox: PropTypes.bool.isRequired, withFilePath: PropTypes.bool, diff --git a/src/drive/web/modules/move/FileList.jsx b/src/drive/web/modules/move/FileList.jsx index 1903df3496..0932fff180 100644 --- a/src/drive/web/modules/move/FileList.jsx +++ b/src/drive/web/modules/move/FileList.jsx @@ -8,8 +8,7 @@ import { isEncryptedFolder } from 'drive/lib/encryption' const isInvalidMoveTarget = (subjects, target) => { const isASubject = subjects.find(subject => subject._id === target._id) const isAFile = target.type === 'file' - - return isAFile || isASubject + return isAFile || isASubject !== undefined } const FileList = ({ targets, files, folder, navigateTo }) => { @@ -36,7 +35,7 @@ const FileList = ({ targets, files, folder, navigateTo }) => { styleDisabled={isInvalidMoveTarget(targets, file)} attributes={file} displayedFolder={null} - actions={[]} + actions={null} isRenaming={false} onFolderOpen={id => navigateTo(files.find(f => f.id === id))} onFileOpen={() => {}} diff --git a/src/drive/web/modules/move/Topbar.jsx b/src/drive/web/modules/move/Topbar.jsx index 9280df563e..1f3b1fbb7a 100644 --- a/src/drive/web/modules/move/Topbar.jsx +++ b/src/drive/web/modules/move/Topbar.jsx @@ -55,7 +55,7 @@ const MoveTopbar = ( MoveTopbar.propTypes = { navigateTo: PropTypes.func.isRequired, - currentDir: PropTypes.object.isRequired, + currentDir: PropTypes.object, fetchStatus: PropTypes.string.isRequired, breakpoints: PropTypes.shape({ isMobile: PropTypes.bool