Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit e75133f

Browse files
committed
Only run migration when needed (fixes #64)
1 parent 1a8856a commit e75133f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/TagManager.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ local function genColor(name: string): Color3
6161
return Color3.fromHSV(h, s, v)
6262
end
6363

64+
local function needsMigration(folder: Folder): boolean
65+
if not folder then
66+
return false
67+
end
68+
69+
for _, child in folder:GetChildren() do
70+
if child:IsA("Folder") then
71+
return true
72+
end
73+
end
74+
75+
return false
76+
end
77+
6478
function TagManager.new(store)
6579
local self = setmetatable({
6680
store = store,
@@ -76,7 +90,7 @@ function TagManager.new(store)
7690
TagManager._global = self
7791

7892
-- Migration path to new attribute based format.
79-
if self._defaultTagsFolder then
93+
if needsMigration(self._defaultTagsFolder) then
8094
ChangeHistory:SetWaypoint("Migrating tags folder")
8195

8296
local migrateCount = 0

0 commit comments

Comments
 (0)