From bbe85def23475fc7c97af8212408bcb9245fedf4 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 9 Sep 2024 09:17:27 -0400 Subject: [PATCH] fix #4503 - ensure all state is initialized before rendering --- .../Modules/Admin/Modules/Settings.razor | 208 +++++++++--------- 1 file changed, 107 insertions(+), 101 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Modules/Settings.razor b/Oqtane.Client/Modules/Admin/Modules/Settings.razor index ffe021d92..e1183a821 100644 --- a/Oqtane.Client/Modules/Admin/Modules/Settings.razor +++ b/Oqtane.Client/Modules/Admin/Modules/Settings.razor @@ -9,129 +9,133 @@ @inject IStringLocalizer Localizer @inject IStringLocalizer SharedLocalizer -
- - - @if (_containers != null) - { -
-
- -
- +@if (_initialized) +{ + + + + @if (_containers != null) + { +
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- + @if (PageState.Page.UserId != null) { - foreach (Page p in _pages) + + } + else + { + if (_pages != null) { - if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, p.PermissionList)) + foreach (Page p in _pages) { - + if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, p.PermissionList)) + { + + } } } } - } - + +
-
- } - - - @if (_permissions != null) - { -
-
- + } + + + @if (_permissions != null) + { +
+
+ +
-
- } - - @if (_moduleSettingsType != null) - { - - @ModuleSettingsComponent - - } - @if (_containerSettingsType != null) - { - - @ContainerSettingsComponent + } - } - -
- - @SharedLocalizer["Cancel"] -
-
- - + @if (_moduleSettingsType != null) + { + + @ModuleSettingsComponent + + } + @if (_containerSettingsType != null) + { + + @ContainerSettingsComponent + + } + +
+ + @SharedLocalizer["Cancel"] +
+
+ + +} @code { public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit; + private bool _initialized = false; private ElementReference form; private bool validated = false; private List _containers = new List(); @@ -231,6 +235,8 @@ }; } } + + _initialized = true; } private async Task SaveModule()