-- Author      : MrExillion
-- Create Date : 11/4/2022 2:49:49 PM


-- This is an addition to the code along side the TOC saved variable that is being used here, which is to avoid crashes of WOW
-- The issue is happening when wow is Updated, the root cause is unknown but a reload seems to fix the issue.

iStableMaster = iStableMaster or {};



function ReloadPromt_OnLoad() 
	iStableMasterReloadPromtButton:HookScript("OnClick", function() ReloadUI()

	end);
	
	


end

function iStableMaster:SafetyReload()
--print(iStableMasterNewWowUpdateReloadPromt[2], select(2,GetBuildInfo(), iStableMasterNewWowUpdateReloadPromt[2] == select(2,GetBuildInfo())));
	if( iStableMasterNewWowUpdateReloadPromt == nil)  then
		ShowUIPanel(iStableMasterReloadPromt);
		
		iStableMasterNewWowUpdateReloadPromt = {GetBuildInfo()};
	elseif (iStableMasterNewWowUpdateReloadPromt[1] ~= select(1,GetBuildInfo()) ) or (iStableMasterNewWowUpdateReloadPromt[2] ~= select(2,GetBuildInfo()) ) then
		ShowUIPanel(iStableMasterReloadPromt);
		
		iStableMasterNewWowUpdateReloadPromt = {GetBuildInfo()};
	end
	
	--if(not iStableMasterReloadPromt:IsShown()) then 
	--	if(select(1,GetBuildInfo()) == "10.0.0" or select(1,GetBuildInfo()) == "10.0.2") then
	--	ShowUIPanel(iStableMasterReloadPromt);
		
	--	iStableMasterNewWowUpdateReloadPromt = {GetBuildInfo()};
	--	end
	--end

end
