using DeepDrftPublic.Client.Common; using DeepDrftPublic.Client.Services; namespace DeepDrftPublic.Services; /// /// Server-side prerender reader for public-site listener settings (Phase 18 wave 18.6), the sibling of /// . Reads each preference's cookie via /// during prerender and seeds the scoped , which MainLayout then /// rounds through PersistentComponentState into WASM — so the first paint already reflects the /// listener's choice with no wrong-default flash (the streaming-quality analogue of the wrong-theme fix). /// Inherits the shared cookie names + parsers from so the server read and /// the client write agree on one wire format. /// public class SettingsService(PublicSiteSettings settings, IHttpContextAccessor httpAccessor) : SettingsServiceBase { public void CheckSettings() { var cookies = httpAccessor.HttpContext?.Request.Cookies; if (cookies is null) return; cookies.TryGetValue(StreamQualityCookieName, out var streamQuality); settings.StreamQuality = ParseStreamQuality(streamQuality); } }