TellMeWhen

TellMeWhen

24M Downloads

[Bug] SNIPPETS "ON_PROFILE" working wrong

cordankos opened this issue ยท 1 comments

commented

**What version of TellMeWhen are you using? **
8.6.0

What steps will reproduce the problem?

  1. Create 2 profiles with lua profile snippets
  2. Write in each snippet different table or function, put them in icon's lua condition for each profile, type of icon "Icon Condition" with condition tab "LUA": "return func()"
  3. Then just swap profiles, second profile will alarm always for nil table or function

What do you expect to happen? What happens instead?
TMW:RegisterCallback("TMW_ON_PROFILE", function(event, profileEvent, arg2, arg3) if profileEvent == "OnProfileChanged" then RunSnippets() end end)
https://github.com/ascott18/TellMeWhen/blob/classic/Components/Core/Snippets/Snippets.lua
This part working wrong, because before get into RunSnippets all groups and icons use setup method. Snippets should be loaded before setup, fixed it through TMW_GLOBAL_UPDATE to run profile snippets which is not running BEFORE frames :setup(). Happens only when you SWAP profiles, on initialize works OK.

Screenshots and Export Strings
Not required, fix above.

Additional Info
Not required, fix above.

commented

Registered callback on TMW_GLOBAL_UPDATE must exist to load snippets BEFORE :setup for frames, this fixing errors for nil