Unset frame storage on channel hide to prevent uneeded iteration."

This commit is contained in:
Andrew Tomaka 2011-05-27 21:49:47 -04:00
parent b9c46370a6
commit 476a5e4398

View file

@ -34,16 +34,14 @@ function core:RejoinChannels(...)
currentChannels[select(i,GetChannelList())] = true
end
for channel,information in pairs(ChatSaverDB) do
for channel,_ in pairs(ChatSaverDB) do
if(currentChannels[channel] == nil) then
JoinPermanentChannel(channel);
for index,shown in pairs(ChatSaverDB[channel].frames) do
if(shown) then
for index,_ in pairs(ChatSaverDB[channel].frames) do
ChatFrame_AddChannel(_G['ChatFrame'..index],channel);
end
end
end
end
self:UnregisterEvent('CHANNEL_UI_UPDATE');
end
@ -99,6 +97,6 @@ function core:ToggleChatChannel(checked,channel)
if(checked) then
ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = true;
else
ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = false;
ChatSaverDB[channel]['frames'][FCF_GetCurrentChatFrameID()] = nil;
end
end