Show hidden files by default

Since there is no other way to enable hidden files, it seems better to
enable it by default otherwise there are some folders/files you simply
can never open from the dialog.
This commit is contained in:
Asher 2019-05-20 16:08:16 -05:00
parent 4a29cd1664
commit a2ad3d4ff4
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC

View File

@ -52,7 +52,15 @@ export type DialogOptions = OpenDialogOptions | SaveDialogOptions;
export const showOpenDialog = (options: OpenDialogOptions): Promise<string> => {
return new Promise<string>((resolve, reject): void => {
const dialog = new Dialog(DialogType.Open, options);
// Make the default to show hidden files and directories since there is no
// other way to make them visible in the dialogs currently.
const dialog = new Dialog(DialogType.Open, typeof options.properties.showHiddenFiles === "undefined" ? {
...options,
properties: {
...options.properties,
showHiddenFiles: true,
},
} : options);
dialog.onSelect((e) => {
dialog.dispose();
resolve(e);