From d4f0805108f8dd5164539d00cc08bd6740356056 Mon Sep 17 00:00:00 2001 From: David Montesinos <90258222+mdmontesinos@users.noreply.github.com> Date: Fri, 6 Jun 2025 10:05:40 +0200 Subject: [PATCH] fix #5352: remove requests to cookie consent service when not enabled --- Oqtane.Client/Themes/Controls/Theme/CookieConsent.razor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Oqtane.Client/Themes/Controls/Theme/CookieConsent.razor b/Oqtane.Client/Themes/Controls/Theme/CookieConsent.razor index 66626cbc..207de910 100644 --- a/Oqtane.Client/Themes/Controls/Theme/CookieConsent.razor +++ b/Oqtane.Client/Themes/Controls/Theme/CookieConsent.razor @@ -103,6 +103,9 @@ { var cookieConsentSetting = SettingService.GetSetting(PageState.Site.Settings, "CookieConsent", string.Empty); _enabled = !string.IsNullOrEmpty(cookieConsentSetting); + + if (!_enabled) return; + _optout = cookieConsentSetting == "optout"; _actioned = await CookieConsentService.IsActionedAsync(); @@ -164,4 +167,4 @@ StateHasChanged(); } } -} \ No newline at end of file +}