Fix auto parse url if app is closed
This commit is contained in:
@@ -60,12 +60,14 @@
|
||||
url = [url substringFromIndex:5];
|
||||
if ([url hasPrefix:@"//"])
|
||||
url = [url substringFromIndex:2];
|
||||
[FeedDownload autoDownloadAndParseURL:url];
|
||||
[FeedDownload autoDownloadAndParseURL:url successBlock:^{
|
||||
[self reopenPreferencesIfOpen];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Handle Menu Interaction
|
||||
#pragma mark - App Preferences
|
||||
|
||||
|
||||
/// Called whenever the user activates the preferences (either through menu click or hotkey).
|
||||
@@ -87,6 +89,16 @@
|
||||
[FeedDownload scheduleUpdateForUpcomingFeeds];
|
||||
}
|
||||
|
||||
/// Close previous preferences window and re-open at the same position (will drop undo manager stack!)
|
||||
- (void)reopenPreferencesIfOpen {
|
||||
if (self.prefWindow) {
|
||||
CGPoint screenPoint = self.prefWindow.window.frame.origin;
|
||||
[self.prefWindow close];
|
||||
[self openPreferences];
|
||||
[self.prefWindow.window setFrameOrigin:screenPoint];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Core Data stack
|
||||
|
||||
@@ -109,10 +121,6 @@
|
||||
return _persistentContainer;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Core Data Saving and Undo support
|
||||
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
// Save changes in the application's managed object context before the application terminates.
|
||||
NSManagedObjectContext *context = self.persistentContainer.viewContext;
|
||||
|
||||
Reference in New Issue
Block a user