Merge pull request #5315 from sbwalker/dev

fix initialization issue related to time zones
This commit is contained in:
Shaun Walker 2025-05-16 09:09:21 -04:00 committed by GitHub
commit 31aba14507
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,8 @@
@inject IStringLocalizer<SharedResources> SharedLocalizer @inject IStringLocalizer<SharedResources> SharedLocalizer
@inject ISettingService SettingService @inject ISettingService SettingService
@if (_initialized)
{
@if (PageState.Site.AllowRegistration) @if (PageState.Site.AllowRegistration)
{ {
if (!_userCreated) if (!_userCreated)
@ -88,8 +90,10 @@ else
{ {
<ModuleMessage Message="@Localizer["Info.Registration.Disabled"]" Type="MessageType.Info" /> <ModuleMessage Message="@Localizer["Info.Registration.Disabled"]" Type="MessageType.Info" />
} }
}
@code { @code {
private bool _initialized = false;
private List<Models.TimeZone> _timezones; private List<Models.TimeZone> _timezones;
private string _passwordrequirements; private string _passwordrequirements;
private string _username = string.Empty; private string _username = string.Empty;
@ -113,6 +117,7 @@ else
_allowsitelogin = bool.Parse(SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:AllowSiteLogin", "true")); _allowsitelogin = bool.Parse(SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:AllowSiteLogin", "true"));
_timezones = await TimeZoneService.GetTimeZonesAsync(); _timezones = await TimeZoneService.GetTimeZonesAsync();
_timezoneid = PageState.Site.TimeZoneId; _timezoneid = PageState.Site.TimeZoneId;
_initialized = true;
} }
protected override void OnParametersSet() protected override void OnParametersSet()