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), }; };