mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 01:13:03 +08:00
[mac] Fix for cancelling Dialogs. Fixes #1047
This commit is contained in:
parent
0571deb290
commit
e2f3a11a33
@ -540,6 +540,10 @@
|
||||
|
||||
// Setup callback handler
|
||||
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
||||
if ( returnCode != NSModalResponseOK) {
|
||||
processOpenFileDialogResponse("[]");
|
||||
return;
|
||||
}
|
||||
NSMutableArray *arr = [NSMutableArray new];
|
||||
for (NSURL *url in [dialog URLs]) {
|
||||
[arr addObject:[url path]];
|
||||
@ -592,10 +596,12 @@
|
||||
|
||||
// Setup callback handler
|
||||
[dialog beginSheetModalForWindow:self.mainWindow completionHandler:^(NSModalResponse returnCode) {
|
||||
NSURL *url = [dialog URL];
|
||||
if ( url != nil ) {
|
||||
processSaveFileDialogResponse([url.path UTF8String]);
|
||||
return;
|
||||
if ( returnCode == NSModalResponseOK ) {
|
||||
NSURL *url = [dialog URL];
|
||||
if ( url != nil ) {
|
||||
processSaveFileDialogResponse([url.path UTF8String]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
processSaveFileDialogResponse("");
|
||||
}];
|
||||
|
Loading…
Reference in New Issue
Block a user