only allow essential cookies when cookie consent not granted.
This commit is contained in:
@ -107,7 +107,7 @@
|
||||
{
|
||||
<Pane Name="Footer" />
|
||||
}
|
||||
<CookieConsent Enabled="@_displayCookieConsent" />
|
||||
<CookieConsent />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@ -119,7 +119,6 @@
|
||||
private bool _login = true;
|
||||
private bool _register = true;
|
||||
private bool _footer = false;
|
||||
private bool _displayCookieConsent = false;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
@ -129,7 +128,6 @@
|
||||
_login = bool.Parse(SettingService.GetSetting(settings, GetType().Namespace + ":Login", "true"));
|
||||
_register = bool.Parse(SettingService.GetSetting(settings, GetType().Namespace + ":Register", "true"));
|
||||
_footer = bool.Parse(SettingService.GetSetting(settings, GetType().Namespace + ":Footer", "false"));
|
||||
_displayCookieConsent = bool.Parse(SettingService.GetSetting(settings, GetType().Namespace + ":DisplayCookieConsent", "false"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -49,16 +49,6 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="displayCookieConsent" ResourceKey="DisplayCookieConsent" ResourceType="@resourceType" HelpText="Specify whether display the cookie consent bar.">Display Cookie Consent?</Label>
|
||||
<div class="col-sm-9">
|
||||
<select id="footer" class="form-select" @bind="@_displayCookieConsent">
|
||||
<option value="-"><@SharedLocalizer["Not Specified"]></option>
|
||||
<option value="true">@SharedLocalizer["Yes"]</option>
|
||||
<option value="false">@SharedLocalizer["No"]</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@ -68,7 +58,6 @@
|
||||
private string _login = "-";
|
||||
private string _register = "-";
|
||||
private string _footer = "-";
|
||||
private string _displayCookieConsent = "-";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@ -96,7 +85,6 @@
|
||||
_login = SettingService.GetSetting(settings, GetType().Namespace + ":Login", "true");
|
||||
_register = SettingService.GetSetting(settings, GetType().Namespace + ":Register", "true");
|
||||
_footer = SettingService.GetSetting(settings, GetType().Namespace + ":Footer", "false");
|
||||
_displayCookieConsent = SettingService.GetSetting(settings, GetType().Namespace + ":DisplayCookieConsent", "false");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -105,7 +93,6 @@
|
||||
_login = SettingService.GetSetting(settings, GetType().Namespace + ":Login", "-");
|
||||
_register = SettingService.GetSetting(settings, GetType().Namespace + ":Register", "-");
|
||||
_footer = SettingService.GetSetting(settings, GetType().Namespace + ":Footer", "-");
|
||||
_displayCookieConsent = SettingService.GetSetting(settings, GetType().Namespace + ":DisplayCookieConsent", "-");
|
||||
}
|
||||
await Task.Yield();
|
||||
}
|
||||
@ -144,11 +131,6 @@
|
||||
{
|
||||
settings = SettingService.SetSetting(settings, GetType().Namespace + ":Footer", _footer);
|
||||
}
|
||||
if (_displayCookieConsent != "-")
|
||||
{
|
||||
settings = SettingService.SetSetting(settings, GetType().Namespace + ":DisplayCookieConsent", _displayCookieConsent);
|
||||
}
|
||||
|
||||
await SettingService.UpdateSiteSettingsAsync(settings, PageState.Site.SiteId);
|
||||
}
|
||||
else
|
||||
@ -166,10 +148,6 @@
|
||||
{
|
||||
settings = SettingService.SetSetting(settings, GetType().Namespace + ":Footer", _footer);
|
||||
}
|
||||
if (_displayCookieConsent != "-")
|
||||
{
|
||||
settings = SettingService.SetSetting(settings, GetType().Namespace + ":DisplayCookieConsent", _displayCookieConsent);
|
||||
}
|
||||
await SettingService.UpdatePageSettingsAsync(settings, pageId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user