mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: Notification 'Show' button visible when no actions exist (#39014)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -64,6 +64,11 @@ void CocoaNotification::Show(const NotificationOptions& options) {
|
||||
options.reply_placeholder)];
|
||||
}
|
||||
|
||||
// We need to explicitly set this to false if there are no
|
||||
// actions, otherwise a Show button will appear by default.
|
||||
if (options.actions.size() == 0)
|
||||
[notification_ setHasActionButton:false];
|
||||
|
||||
int i = 0;
|
||||
action_index_ = UINT_MAX;
|
||||
NSMutableArray* additionalActions =
|
||||
@@ -75,7 +80,6 @@ void CocoaNotification::Show(const NotificationOptions& options) {
|
||||
// become additional actions.
|
||||
if (!options.has_reply && action_index_ == UINT_MAX) {
|
||||
// First button observed is the displayed action
|
||||
[notification_ setHasActionButton:true];
|
||||
[notification_
|
||||
setActionButtonTitle:base::SysUTF16ToNSString(action.text)];
|
||||
action_index_ = i;
|
||||
|
||||
Reference in New Issue
Block a user