Skip to content

Commit

Permalink
fix: remove item from selection if it's deleted (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramilito authored Oct 30, 2024
1 parent 2341c74 commit 2e5fc77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/kubectl/actions/informer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ local function process_event(builder, event_string)
elseif event.type == "DELETED" then
for index, item in ipairs(is_table and target.rows or target) do
if (is_table and item.object.metadata.name or item.metadata.name) == event_name then
for selection_index, selection in ipairs(state.selections) do
if selection.name == item.metadata.name then
table.remove(state.selections, selection_index)
end
end
table.remove(is_table and target.rows or target, index)
break
end
Expand Down

0 comments on commit 2e5fc77

Please sign in to comment.