component rendering optimizations

This commit is contained in:
sbwalker
2024-01-04 13:47:51 -05:00
parent d35ef2d360
commit f75179b2f6
7 changed files with 61 additions and 44 deletions

View File

@ -95,7 +95,7 @@ else
if (authorized)
{
CreateComponent(builder, module);
CreateComponent(builder, module, module.PageModuleId);
}
}
}
@ -106,7 +106,7 @@ else
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.PermissionList))
{
CreateComponent(builder, module);
CreateComponent(builder, module, -1);
}
}
}
@ -115,11 +115,14 @@ else
};
}
private void CreateComponent(RenderTreeBuilder builder, Module module)
private void CreateComponent(RenderTreeBuilder builder, Module module, int key)
{
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
builder.AddAttribute(1, "ModuleState", module);
builder.SetKey(module.PageModuleId);
if (key != -1)
{
builder.SetKey(module.PageModuleId);
}
builder.CloseComponent();
}
}