Skip to content

Commit

Permalink
Memory: Delay the auto-loading of the chat settings until the default…
Browse files Browse the repository at this point in the history
… chat frames have been loaded for a bit
  • Loading branch information
sylvanaar committed Jun 5, 2020
1 parent 795b525 commit 5abc6ea
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion modules/Memory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,28 @@ end
}
})

Prat:SetModuleInit(module.name,
function(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
end)

function module:PLAYER_ENTERING_WORLD()
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self.ready = true
if self.needaLoading then
self:LoadSettings()
end
end

function module:OnModuleEnable()
self.db.RegisterCallback(self, "OnProfileShutdown")

if self.db.profile.autoload and next(self.db.profile.frames) then
self:LoadSettings()
if not self.ready then
self.needsLoading = true
else
self:LoadSettings()
end
end
end

Expand Down Expand Up @@ -256,6 +273,7 @@ end
end

function module:LoadSettings()
self.needsLoading = nil
local db = self.db.profile

if not next(db.frames) then
Expand Down

0 comments on commit 5abc6ea

Please sign in to comment.