fix (search): set visibility of hidden files in the search result as per config

This commit is contained in:
= 2019-04-25 03:04:03 +10:00
parent 8af1ba290a
commit 2c124561e6
2 changed files with 12 additions and 5 deletions

View file

@ -213,12 +213,18 @@ export class FilesPage extends React.Component {
if(this._search){
this._search.unsubscribe();
}
this._search = onSearch(search, this.state.path).subscribe((f) => {
this._search = onSearch(search, this.state.path).subscribe((f = []) => {
let l = f.length;
for(let i=0; i<l; i++){
f[i].link = createLink(f[i].type, f[i].path);
if(this.state.show_hidden == false){
if(f[i].path.split("/").filter((chunk) => chunk[0] === "." ? true : false).length > 0){
delete f[i].type;
}
}
}
this.setState({
files: f.map((f) => {
f.link = createLink(f.type, f.path);
return f;
}) || [],
files: f,
is_search: true,
metadata: {
can_rename: false,

View file

@ -31,6 +31,7 @@ export class FileSystem extends React.PureComponent {
if(file.type === 'directory' || file.type === 'file' || file.type === 'link' || file.type === 'bucket'){
return ( <ExistingThing view={this.props.view} key={file.name+file.path+(file.icon || '')} file={file} path={this.props.path} metadata={this.props.metadata || {}} selectableKey={file} selected={this.props.selected.indexOf(file.path) !== -1} currentSelection={this.props.selected} /> );
}
return null;
})
}
</ReactCSSTransitionGroup>