Skip to content

Commit

Permalink
Use supplied filter by default
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Bodeen <[email protected]>
  • Loading branch information
gbodeen authored and colin-grant-work committed Jun 30, 2021
1 parent 0ebdec5 commit 3b49f05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class FileDialogTreeFiltersRenderer extends ReactRenderer {
super();
this.suppliedFilters = options.suppliedFilters;
this.fileDialogTree = options.fileDialogTree;
this.appliedFilters = { 'All Files': [], ...this.suppliedFilters, };
this.appliedFilters = { ...this.suppliedFilters, 'All Files': [], };
}

protected readonly handleFilterChanged = (e: React.ChangeEvent<HTMLSelectElement>) => this.onFilterChanged(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ElectronFileDialogService extends DefaultFileDialogService {
const defaultPath = FileUri.fsPath(uri);
const filters: FileFilter[] = [{ name: 'All Files', extensions: ['*'] }];
if (props.filters) {
filters.push(...Object.keys(props.filters).map(key => ({ name: key, extensions: props.filters![key] })));
filters.unshift(...Object.keys(props.filters).map(key => ({ name: key, extensions: props.filters![key] })));
}
return { title, defaultPath, filters };
}
Expand Down

0 comments on commit 3b49f05

Please sign in to comment.