Add conditional so resource tree will only refresh if it's actually rendered