Skip to content

Commit f2cfd55

Browse files
committed
fix(store): iterations for clearing bound store
1 parent dc84120 commit f2cfd55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/nougat/store/init.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ local function on_tab_closed()
6262
active_tabid[tabid] = true
6363
end
6464

65-
for _, storage in pairs(registry.tab) do
66-
for tabid in pairs(storage) do
67-
if not active_tabid[tabid] then
68-
storage[tabid] = nil
65+
for _, store in pairs(registry.tab) do
66+
for tabid in pairs(store) do
67+
if type(tabid) == "number" and not active_tabid[tabid] then
68+
store[tabid] = nil
6969
end
7070
end
7171
end
@@ -170,7 +170,7 @@ function mod._clear(target_type, target_name)
170170
---@cast store NougatStore
171171
store:clear()
172172
else
173-
for id in ipairs(store) do
173+
for id in pairs(store) do
174174
if type(id) == "number" then
175175
store[id] = nil
176176
end

0 commit comments

Comments
 (0)