From c2603aaac2b5f6eee370c69a11c8aefc507d58ae Mon Sep 17 00:00:00 2001 From: Shubham Date: Sat, 3 Jun 2017 11:48:18 -0400 Subject: [PATCH] :art: Add documentation --- atom/browser/ui/file_dialog_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/file_dialog_mac.mm b/atom/browser/ui/file_dialog_mac.mm index 0dc731f04a..c33f5c919e 100644 --- a/atom/browser/ui/file_dialog_mac.mm +++ b/atom/browser/ui/file_dialog_mac.mm @@ -75,8 +75,11 @@ void SetupDialog(NSSavePanel* dialog, if (settings.filters.empty()) [dialog setAllowsOtherFileTypes:YES]; - else + else { + // Set setAllowedFileTypes before setNameFieldStringValue as it might + // override the extension set using setNameFieldStringValue SetAllowedFileTypes(dialog, settings.filters); + } if (default_dir) [dialog setDirectoryURL:[NSURL fileURLWithPath:default_dir]];