mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-14 15:48:15 +00:00
feat(client-registry): add getMeasurementUnit
This commit is contained in:
@@ -17,3 +17,13 @@ export const getShowWeatherWidget = () =>
|
|||||||
|
|
||||||
export const getShowNewsWidget = () =>
|
export const getShowNewsWidget = () =>
|
||||||
getClientConfig('showNewsWidget', 'true') === 'true';
|
getClientConfig('showNewsWidget', 'true') === 'true';
|
||||||
|
|
||||||
|
export const getMeasurementUnit = () => {
|
||||||
|
const value =
|
||||||
|
getClientConfig('measureUnit') ??
|
||||||
|
getClientConfig('measurementUnit', 'metric');
|
||||||
|
|
||||||
|
if (typeof value !== 'string') return 'metric';
|
||||||
|
|
||||||
|
return value.toLowerCase();
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user