From 3b49f059ba09ef7a3fa0cc0b4b58525354c28d0b Mon Sep 17 00:00:00 2001 From: Gabriel Bodeen Date: Tue, 29 Jun 2021 00:17:43 +0200 Subject: [PATCH] Use supplied filter by default Signed-off-by: Gabriel Bodeen --- .../browser/file-dialog/file-dialog-tree-filters-renderer.tsx | 2 +- .../file-dialog/electron-file-dialog-service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx b/packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx index 7a8075b9e2465..abdb02eed7ed2 100644 --- a/packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx +++ b/packages/filesystem/src/browser/file-dialog/file-dialog-tree-filters-renderer.tsx @@ -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) => this.onFilterChanged(e); diff --git a/packages/filesystem/src/electron-browser/file-dialog/electron-file-dialog-service.ts b/packages/filesystem/src/electron-browser/file-dialog/electron-file-dialog-service.ts index 1c93f41ef7d2e..924e8301f3ed3 100644 --- a/packages/filesystem/src/electron-browser/file-dialog/electron-file-dialog-service.ts +++ b/packages/filesystem/src/electron-browser/file-dialog/electron-file-dialog-service.ts @@ -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 }; }