@@ -110,7 +110,7 @@ + (void)initialize {
110110 // Without this line, GitUp would instead immediately exit, with no crash log.
111111 // libgit2 has what looks like a built-in solution (`disable_signals()`), but it doesn't seem to work for us.
112112 signal (SIGPIPE , SIG_IGN );
113-
113+
114114 NSDictionary * defaults = @{
115115 GICommitMessageViewUserDefaultKey_ShowInvisibleCharacters : @(YES ),
116116 GICommitMessageViewUserDefaultKey_ShowMargins : @(YES ),
@@ -178,20 +178,20 @@ - (void)handleDocumentCountChanged {
178178}
179179
180180- (void )_showNotificationWithTitle : (NSString *)title action : (SEL )action message : (NSString *)format , ... NS_FORMAT_FUNCTION(3 , 4 ) {
181- va_list arguments;
182- va_start (arguments, format);
183- NSString * string = [[NSString alloc ] initWithFormat: format arguments: arguments];
184- va_end (arguments);
185-
186- UNMutableNotificationContent * content = [[UNMutableNotificationContent alloc ] init ];
187- content.title = title;
188- content.body = string;
189- if (action) {
190- content.userInfo = @{kNotificationUserInfoKey_Action : NSStringFromSelector (action)};
191- }
181+ va_list arguments;
182+ va_start (arguments, format);
183+ NSString * string = [[NSString alloc ] initWithFormat: format arguments: arguments];
184+ va_end (arguments);
185+
186+ UNMutableNotificationContent * content = [[UNMutableNotificationContent alloc ] init ];
187+ content.title = title;
188+ content.body = string;
189+ if (action) {
190+ content.userInfo = @{kNotificationUserInfoKey_Action : NSStringFromSelector (action)};
191+ }
192192
193- UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier: [[NSUUID UUID ] UUIDString ] content: content trigger: nil ];
194- [[UNUserNotificationCenter currentNotificationCenter ] addNotificationRequest: request withCompletionHandler: nil ];
193+ UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier: [[NSUUID UUID ] UUIDString ] content: content trigger: nil ];
194+ [[UNUserNotificationCenter currentNotificationCenter ] addNotificationRequest: request withCompletionHandler: nil ];
195195}
196196
197197#pragma mark - NSApplicationDelegate
@@ -219,15 +219,15 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification {
219219 [GILaunchServicesLocator setup ];
220220
221221 // Initialize user notification center
222- UNUserNotificationCenter * center = [UNUserNotificationCenter currentNotificationCenter ];
222+ UNUserNotificationCenter * center = [UNUserNotificationCenter currentNotificationCenter ];
223223 [center setDelegate: self ];
224-
224+
225225 [center requestAuthorizationWithOptions: (UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge )
226- completionHandler: ^(BOOL granted, NSError * _Nullable error) {
227- if (!granted) {
228- XLOG_INFO (@" User denied notification permissions" );
229- }
230- }];
226+ completionHandler: ^(BOOL granted, NSError * _Nullable error) {
227+ if (!granted) {
228+ XLOG_INFO (@" User denied notification permissions" );
229+ }
230+ }];
231231
232232 // Register finder context menu services.
233233 [NSApplication sharedApplication ].servicesProvider = [ServicesProvider new ];
@@ -575,8 +575,8 @@ - (void)updater:(SUUpdater*)updater willInstallUpdateOnQuit:(SUAppcastItem*)item
575575
576576#pragma mark - UNUserNotificationCenterDelegate
577577
578- - (void )userNotificationCenter : (UNUserNotificationCenter *)center didReceiveNotificationResponse : (UNNotificationResponse *)response withCompletionHandler : (void (^)(void ))completionHandler {
579- NSString * action = response.notification .request .content .userInfo [kNotificationUserInfoKey_Action ];
578+ - (void )userNotificationCenter : (UNUserNotificationCenter *)center didReceiveNotificationResponse : (UNNotificationResponse *)response withCompletionHandler : (void (^)(void ))completionHandler {
579+ NSString * action = response.notification .request .content .userInfo [kNotificationUserInfoKey_Action ];
580580 if (action) {
581581 [NSApp sendAction: NSSelectorFromString (action) to: self from: nil ];
582582 }
0 commit comments