Quantcast

Add a small timer to refresh a bit after load

MilleXIV [09-02-16 - 12:01]
Add a small timer to refresh a bit after load
Filename
core.lua
diff --git a/core.lua b/core.lua
index 771b52b..9bb95c7 100644
--- a/core.lua
+++ b/core.lua
@@ -155,10 +155,7 @@ function XIVBar:OnInitialize()
   options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
   self.profilesOptionFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(AddOnName, 'Profiles', "XIV Bar", "profiles")

-  --LibStub("AceConfig-3.0"):RegisterOptionsTable(AddOnName.."-Profiles", )
-
-
-
+  self.timerRefresh = false

   self:RegisterChatCommand('xivbar', 'ToggleConfig')
 end
@@ -170,6 +167,13 @@ function XIVBar:OnEnable()
   self.db.RegisterCallback(self, 'OnProfileCopied', 'Refresh')
   self.db.RegisterCallback(self, 'OnProfileChanged', 'Refresh')
   self.db.RegisterCallback(self, 'OnProfileReset', 'Refresh')
+
+  if not self.timerRefresh then
+    C_Timer.After(5, function()
+      self:Refresh()
+      self.timerRefresh = true
+    end)
+  end
 end

 function XIVBar:ToggleConfig()