Skip to content

Commit

Permalink
Fix error from duplicate tag entries
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffany352 committed Dec 2, 2021
1 parent 5b6556f commit b143c59
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/TagManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function TagManager.new(store)
nameChangedSignals = {},
tags = {},
onUpdate = {},
_gaveDuplicateWarningsFor = {},
}, TagManager)

TagManager._global = self
Expand Down Expand Up @@ -220,15 +221,30 @@ end

function TagManager:_doUpdateStore()
self.updateTriggered = false
local tags: { [number]: Tag } = {}
local tags: { Tag } = {}
local groups: { [string]: boolean } = {}
local sel = Selection:Get()
local tagNamesSeen: { [string]: boolean } = {}

if self.tagsFolder then
for _, inst in pairs(self.tagsFolder:GetChildren()) do
if not inst:IsA("Configuration") then
continue
end
if tagNamesSeen[inst.Name] then
if not self._gaveDuplicateWarningsFor[inst.Name] then
warn(
string.format(
"Multiple tags in ServerStorage.TagList are named %q, consider removing the duplicates.",
inst.Name
)
)
self._gaveDuplicateWarningsFor[inst.Name] = true
end
continue
end
tagNamesSeen[inst.Name] = true

local hasAny = false
local missingAny = false
local entry: Tag = {
Expand Down

0 comments on commit b143c59

Please sign in to comment.