Fix #11369 (New layers are not active with new legend)