Skip to content

Commit

Permalink
don't lose our iteration state when refreshing the list
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Feb 26, 2024
1 parent f558405 commit 76b9dc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gui/notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ NotifyOverlay.ATTRS{
}

function NotifyOverlay:init()
self.state = {}

self:addviews{
widgets.Panel{
view_id='panel',
Expand All @@ -34,7 +36,8 @@ function NotifyOverlay:init()
-- have wasd mapped to the arrow keys
scroll_keys={},
on_submit=function(_, choice)
choice.state = choice.data.on_click(choice.state)
local prev_state = self.state[choice.data.name]
self.state[choice.data.name] = choice.data.on_click(prev_state)
end,
},
},
Expand Down

0 comments on commit 76b9dc4

Please sign in to comment.