Skip to content

Commit

Permalink
Fix regression: don't wait when not using reply or actions
Browse files Browse the repository at this point in the history
  • Loading branch information
julienXX committed Oct 2, 2016
1 parent 4974d63 commit f73e270
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Terminal Notifier/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification;
options[@"output"] = @"json";
}

options[@"timeout"] = @"0";
if (defaults[@"timeout"]) options[@"timeout"] = defaults[@"timeout"];
options[@"uuid"] = [NSString stringWithFormat:@"%ld", self.hash];
options[@"timeout"] = defaults[@"timeout"] ? defaults[@"timeout"] : @"0";

if (options[@"reply"] || defaults[@"timeout"] || defaults[@"actions"]) options[@"waitForResponse"] = @YES;

if (defaults[@"open"]) {
/*
Expand Down Expand Up @@ -415,6 +417,8 @@ - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center
- (void)userNotificationCenter:(NSUserNotificationCenter *)center
didDeliverNotification:(NSUserNotification *)userNotification;
{
if (!userNotification.userInfo[@"waitForResponse"]) exit(0);

currentNotification = userNotification;

dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
Expand Down Expand Up @@ -443,7 +447,6 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center
NSDictionary *udict = @{@"activationType" : @"timeout"};
[self Quit:udict notification:userNotification];
exit(0);

});
}
}
Expand Down

0 comments on commit f73e270

Please sign in to comment.