MacGui: hide the notification action button if there is no file url

Fix #6142.

(cherry picked from commit 689bd4941d)
This commit is contained in:
Damiano Galassi 2024-06-19 11:37:53 +02:00
parent 254ca3334b
commit c78dd5df2d
No known key found for this signature in database
GPG Key ID: 5452E231DFDBCA11
1 changed files with 5 additions and 0 deletions

View File

@ -416,12 +416,17 @@ NSString * const HBQueueItemNotificationPathKey = @"HBQueueItemNotificationPathK
notification.title = title;
notification.informativeText = description;
notification.soundName = playSound ? NSUserNotificationDefaultSoundName : nil;
if (fileURL)
{
notification.hasActionButton = YES;
notification.actionButtonTitle = NSLocalizedString(@"Show", @"Notification -> Show in Finder");
notification.userInfo = @{ HBQueueItemNotificationPathKey: fileURL.path };
}
else
{
notification.hasActionButton = NO;
}
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
}