mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fix: allowed dialog file types with one filter (#46900)
This commit is contained in:
@@ -131,10 +131,6 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
||||
[file_types_list addObject:content_types_set];
|
||||
}
|
||||
|
||||
// Don't add file format picker.
|
||||
if ([file_types_list count] <= 1)
|
||||
return;
|
||||
|
||||
NSArray* content_types = [file_types_list objectAtIndex:0];
|
||||
|
||||
__block BOOL allowAllFiles = NO;
|
||||
@@ -148,6 +144,10 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) {
|
||||
|
||||
[dialog setAllowedContentTypes:allowAllFiles ? @[] : content_types];
|
||||
|
||||
// Don't add file format picker.
|
||||
if ([file_types_list count] <= 1)
|
||||
return;
|
||||
|
||||
// Add file format picker.
|
||||
ElectronAccessoryView* accessoryView = [[ElectronAccessoryView alloc]
|
||||
initWithFrame:NSMakeRect(0.0, 0.0, 200, 32.0)];
|
||||
|
||||
Reference in New Issue
Block a user