try strip desktop
This commit is contained in:
@@ -86,6 +86,37 @@ export const defaultVariablePrefs: VariablePrefs = {
|
||||
|
||||
export const storedVariablePrefs = persisted<VariablePrefs>('variable_prefs', defaultVariablePrefs);
|
||||
|
||||
/** Order of the hourly-table rows (visibility is the separate toggle above). */
|
||||
export const defaultTableRowOrder: string[] = [
|
||||
'icons',
|
||||
'temperature',
|
||||
'feels',
|
||||
'dew_point',
|
||||
'wind',
|
||||
'gusts',
|
||||
'humidity',
|
||||
'clouds',
|
||||
'pressure',
|
||||
'uv',
|
||||
'visibility',
|
||||
'precipitation',
|
||||
'snowfall'
|
||||
];
|
||||
|
||||
export const storedTableRowOrder = persisted<string[]>('table_row_order_v1', defaultTableRowOrder);
|
||||
|
||||
/**
|
||||
* Normalizes a stored row order against the known rows: drops keys that no
|
||||
* longer exist and appends new rows (added after the user last saved) at the
|
||||
* end, so stored orders survive app updates.
|
||||
*/
|
||||
export function mergeTableRowOrder(stored: string[]): string[] {
|
||||
return [
|
||||
...stored.filter((k) => defaultTableRowOrder.includes(k)),
|
||||
...defaultTableRowOrder.filter((k) => !stored.includes(k))
|
||||
];
|
||||
}
|
||||
|
||||
/** Hourly table interval: 3-hourly (default) or 1-hourly. */
|
||||
export const storedHourlyInterval = persisted<1 | 3>('hourly_interval', 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user