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 +}