2
0

Need to -resume the task to start it, fixes issue with importing sites.

This commit is contained in:
Maarten Billemont 2017-04-14 00:24:34 -04:00
parent 2bdec415e9
commit 3fcf1131ac

View File

@ -269,8 +269,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
NSURL *url = openPanel.URL; NSURL *url = openPanel.URL;
[openPanel close]; [openPanel close];
[[NSURLSession sharedSession] [[[NSURLSession sharedSession] dataTaskWithURL:url completionHandler:
dataTaskWithURL:url completionHandler:^(NSData *importedSitesData, NSURLResponse *response, NSError *error) { ^(NSData *importedSitesData, NSURLResponse *response, NSError *error) {
if (error) if (error)
err( @"While reading imported sites from %@: %@", url, [error fullDescription] ); err( @"While reading imported sites from %@: %@", url, [error fullDescription] );
if (!importedSitesData) if (!importedSitesData)
@ -342,7 +342,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
break; break;
} }
} ); } );
}]; }] resume];
} }
- (IBAction)togglePreference:(id)sender { - (IBAction)togglePreference:(id)sender {