From 028329ae74c59f9605c7fea8ba3f1f7a6fec1963 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 8 Nov 2024 10:56:28 -0800 Subject: [PATCH] Persist show all devices --- src/settings/DevicesPage.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/settings/DevicesPage.jsx b/src/settings/DevicesPage.jsx index 5e204c3c80..b89fcd07dc 100644 --- a/src/settings/DevicesPage.jsx +++ b/src/settings/DevicesPage.jsx @@ -17,6 +17,7 @@ import { formatTime } from '../common/util/formatter'; import { useDeviceReadonly, useManager } from '../common/util/permissions'; import useSettingsStyles from './common/useSettingsStyles'; import DeviceUsersValue from './components/DeviceUsersValue'; +import usePersistedState from '../common/util/usePersistedState'; const DevicesPage = () => { const classes = useSettingsStyles(); @@ -31,7 +32,7 @@ const DevicesPage = () => { const [timestamp, setTimestamp] = useState(Date.now()); const [items, setItems] = useState([]); const [searchKeyword, setSearchKeyword] = useState(''); - const [showAll, setShowAll] = useState(false); + const [showAll, setShowAll] = usePersistedState('showAllDevices', false); const [loading, setLoading] = useState(false); useEffectAsync(async () => { @@ -110,7 +111,7 @@ const DevicesPage = () => { setShowAll(e.target.checked)} size="small" />