1.8.1
Add table tick boxes for decimals and degree symbols in data Change Soil Moist to %
This commit is contained in:
@@ -207,6 +207,28 @@ export function useAppState() {
|
||||
try { localStorage.setItem('sunscope_pollen_type', v); } catch (e) { /* ignore */ }
|
||||
setPollenType(v);
|
||||
};
|
||||
|
||||
const [showDecimals, setShowDecimals] = useState(() => {
|
||||
try { const s = localStorage.getItem('sunscope_show_decimals'); return s === null ? false : s !== '0'; } catch (e) { return false; }
|
||||
});
|
||||
const toggleShowDecimals = () => setShowDecimals(v => {
|
||||
const next = !v;
|
||||
try { localStorage.setItem('sunscope_show_decimals', next ? '1' : '0'); } catch (e) { /* ignore */ }
|
||||
return next;
|
||||
});
|
||||
|
||||
const [showDegree, setShowDegree] = useState(() => {
|
||||
try {
|
||||
const s = localStorage.getItem('sunscope_show_degree');
|
||||
if (s !== null) return s !== '0';
|
||||
return typeof window !== 'undefined' ? window.innerWidth >= 640 : true;
|
||||
} catch (e) { return true; }
|
||||
});
|
||||
const toggleShowDegree = () => setShowDegree(v => {
|
||||
const next = !v;
|
||||
try { localStorage.setItem('sunscope_show_degree', next ? '1' : '0'); } catch (e) { /* ignore */ }
|
||||
return next;
|
||||
});
|
||||
|
||||
const searchTimeout = useRef(null);
|
||||
|
||||
@@ -429,6 +451,8 @@ export function useAppState() {
|
||||
indoorManaged, setIndoorManaged,
|
||||
indoorMode, setIndoorMode,
|
||||
pollenType, setPollenTypeAndSave,
|
||||
showDecimals, toggleShowDecimals,
|
||||
showDegree, toggleShowDegree,
|
||||
// table refs
|
||||
headStickyRef, headTrackRef, headTableRef,
|
||||
bodyScrollRef, bodyTableRef, tableWrapRef,
|
||||
|
||||
Reference in New Issue
Block a user