Fixed some dump mistakes
This commit is contained in:
@@ -151,9 +151,9 @@ public class CoreConfiguration
|
||||
|
||||
public class CookieData
|
||||
{
|
||||
[JsonProperty("ShowCookieConsentBanner")]
|
||||
[JsonProperty("Enabled")]
|
||||
[Description("This specifies if the cookie consent banner is shown to users.")]
|
||||
public bool ShowBanner { get; set; } = true;
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
[JsonProperty("BannerTitle")]
|
||||
[Description("The title for the cookie consent banner.")]
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
@inject ConfigService<CoreConfiguration> ConfigService
|
||||
@inject IdentityService IdentityService
|
||||
|
||||
@ChildContent
|
||||
|
||||
@if (ConfigService.Get().Customisation.CookieConsentBanner.ShowBanner && !IdentityService.HasFlag("CookieAsked").Result)
|
||||
@if (ShowBanner)
|
||||
{
|
||||
<div class="mb-12 mx-8 d-flex justify-content-end fixed-bottom no-pointer-events" style="pointer-events: none;">
|
||||
<div style="pointer-events: all; max-width: var(--bs-breakpoint-sm)" class="w-100">
|
||||
@@ -31,10 +29,23 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment ChildContent { get; set; }
|
||||
private bool ShowBanner;
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
var userWasAsked = await IdentityService.HasFlag("CookieAsked");
|
||||
|
||||
if (ConfigService.Get().Customisation.CookieConsentBanner.Enabled && !userWasAsked)
|
||||
ShowBanner = true;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Consent()
|
||||
{
|
||||
|
||||
@@ -55,9 +55,8 @@
|
||||
if (IdentityService.IsLoggedIn)
|
||||
{
|
||||
<PermissionChecker>
|
||||
<CookieConsentBanner>
|
||||
@Body
|
||||
</CookieConsentBanner>
|
||||
@Body
|
||||
<CookieConsentBanner/>
|
||||
</PermissionChecker>
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user