Couldn't tell for your actual question (and also I don't know what your addon is meant to actually do), but I do notice something right away:
On spec change, you enable the list (module?) for that spec, but don't disable the others (unless there's some dark magic at work in your code that I can't work out.) So if you changed specs multiple times, you'd just end up having everything enabled, rather than toggling according to spec changes.
Might be worth seeing if that's not causing issues, and if it's not, then it can probably be left as-is. I just thought I'd mention it.
|