From 50d9d9113fb55d1bc00026d8f87f5684cfc4c8e8 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 1 Jul 2021 13:15:10 +0300 Subject: [PATCH] Web: Files: fixed files selection --- products/ASC.Files/Client/src/HOCs/withFileActions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/products/ASC.Files/Client/src/HOCs/withFileActions.js b/products/ASC.Files/Client/src/HOCs/withFileActions.js index b2b4500a376..cb86f9b5725 100644 --- a/products/ASC.Files/Client/src/HOCs/withFileActions.js +++ b/products/ASC.Files/Client/src/HOCs/withFileActions.js @@ -21,7 +21,7 @@ export default function withFileActions(WrappedFileItem) { } onContentFileSelect = (checked, file) => { const { selectRowAction } = this.props; - if (!file) return; + if (!file || file.id === -1) return; selectRowAction(checked, file); }; @@ -33,7 +33,8 @@ export default function withFileActions(WrappedFileItem) { fileContextClick = () => { const { onSelectItem, item } = this.props; - onSelectItem(item); + + item.id !== -1 && onSelectItem(item); }; getSharedButton = (shared) => { @@ -156,11 +157,11 @@ export default function withFileActions(WrappedFileItem) { } else { if (checked) { this.onContentFileSelect(!checked, item); - this.fileContextClick(item); + this.fileContextClick(); } else { if (!isMouseDown) return; this.onContentFileSelect(true, item); - this.fileContextClick(item); + this.fileContextClick(); } } this.setState({ isMouseDown: false });