Skip to content

Commit b43465d

Browse files
committed
fix(1483): FilePickerOpenOptions Fix
1 parent db5efbd commit b43465d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Views/Preferences.axaml.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,16 @@ private async void SelectShellOrTerminal(object _, RoutedEventArgs e)
293293
return;
294294

295295
var shell = Models.ShellOrTerminal.Supported[type];
296-
var options = new FilePickerOpenOptions()
296+
297+
var options = new FilePickerOpenOptions() { AllowMultiple = false };
298+
if (shell.Name != "Custom")
299+
{
300+
options = new FilePickerOpenOptions()
297301
{
298302
FileTypeFilter = [new FilePickerFileType(shell.Name) { Patterns = [shell.Exec] }],
299303
AllowMultiple = false,
300304
};
305+
}
301306

302307
var selected = await StorageProvider.OpenFilePickerAsync(options);
303308
if (selected.Count == 1)
@@ -319,11 +324,15 @@ private async void SelectExternalMergeTool(object _, RoutedEventArgs e)
319324
}
320325

321326
var tool = Models.ExternalMerger.Supported[type];
322-
var options = new FilePickerOpenOptions()
327+
var options = new FilePickerOpenOptions() { AllowMultiple = false };
328+
if (tool.Name != "Custom")
329+
{
330+
options = new FilePickerOpenOptions()
323331
{
324332
FileTypeFilter = [new FilePickerFileType(tool.Name) { Patterns = tool.GetPatterns() }],
325333
AllowMultiple = false,
326334
};
335+
}
327336

328337
var selected = await StorageProvider.OpenFilePickerAsync(options);
329338
if (selected.Count == 1)

0 commit comments

Comments
 (0)