Skip to content

Commit

Permalink
fix: Notification 'Show' button visible when no actions exist (#39012)
Browse files Browse the repository at this point in the history
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Jul 7, 2023
1 parent fa768aa commit c998d2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shell/browser/notifications/mac/cocoa_notification.mm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
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 =
Expand All @@ -75,7 +80,6 @@
// 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;
Expand Down

0 comments on commit c998d2f

Please sign in to comment.