Fixed some dump mistakes

This commit is contained in:
Moritz Deiaco
2024-06-09 10:33:04 +02:00
parent a0f256946e
commit 862b43ae6d
3 changed files with 20 additions and 10 deletions

View File

@@ -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.")]

View File

@@ -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()
{

View File

@@ -55,9 +55,8 @@
if (IdentityService.IsLoggedIn)
{
<PermissionChecker>
<CookieConsentBanner>
@Body
</CookieConsentBanner>
<CookieConsentBanner/>
</PermissionChecker>
}
else