From 333b3f1e79a8a9a572fc0b05a3a5ae2ab186617b Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 9 Oct 2020 11:46:03 +0300 Subject: [PATCH] Web: Files : Panels : Fixed selectors --- .../Client/src/components/panels/NewFilesPanel/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js b/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js index 99c21c2da3..59e85a2b2c 100644 --- a/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js @@ -140,12 +140,12 @@ class NewFilesPanelComponent extends React.Component { onFilesClick = item => { const { id, fileExst, viewUrl } = item; - const { filter, setMediaViewerData, fetchFiles } = this.props; + const { filter, setMediaViewerData, fetchFiles, canWebEdit } = this.props; if (!fileExst) { fetchFiles(id, filter).catch(err => toastr.error(err)); } else { - if (canWebEdit(fileExst)) { + if (canWebEdit) { return window.open(`./doceditor?fileId=${id}`, "_blank"); } @@ -294,13 +294,14 @@ const NewFilesPanel = props => ( ); -const mapStateToProps = state => { +const mapStateToProps = (state, props) => { return { filter: getFilter(state), files: getFiles(state), folders: getFolders(state), treeFolders: getTreeFolders(state), selectedFolder: getSelectedFolder(state), + canWebEdit: canWebEdit(props.item.fileExst)(state), }; };