Merge pull request #3438 from Elv13/fix_3384

Fix 3384
This commit is contained in:
Emmanuel Lepage Vallée 2021-09-17 13:10:58 -07:00 committed by GitHub
commit edf21742b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -57,7 +57,13 @@ local action = {}
-- @propemits true false
--- When a notification is invoked.
--
-- Note that it is possible to call `:invoke()` without a notification object.
-- It is possible the `notification` parameter will be nil.
--
-- @signal invoked
-- @tparam naughty.action action The action.
-- @tparam naughty.notification|nil notification The notification, if known.
function action:get_selected()
return self._private.selected

View File

@ -337,7 +337,10 @@ local function new(_, args)
update_style(wdg)
wdg._private.default_buttons = gtable.join(
abutton({ }, 1, function(a) a:invoke(args.notification) end)
abutton({ }, 1, function(a)
local notif = wdg._private.notification or args.notification
a:invoke(notif)
end)
)
return wdg