From 85f6c3b90138e358330fd891f5036ae26bf3c65d Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Mon, 8 Dec 2025 13:08:52 +0530 Subject: [PATCH] feat(client-registry): add `getMeasurementUnit` --- src/lib/config/clientRegistry.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/config/clientRegistry.ts b/src/lib/config/clientRegistry.ts index 28d0951..f23d7ad 100644 --- a/src/lib/config/clientRegistry.ts +++ b/src/lib/config/clientRegistry.ts @@ -17,3 +17,13 @@ export const getShowWeatherWidget = () => export const getShowNewsWidget = () => getClientConfig('showNewsWidget', 'true') === 'true'; + +export const getMeasurementUnit = () => { + const value = + getClientConfig('measureUnit') ?? + getClientConfig('measurementUnit', 'metric'); + + if (typeof value !== 'string') return 'metric'; + + return value.toLowerCase(); +};