Skip to content

Commit

Permalink
Persist show all devices
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 8, 2024
1 parent 62f6da1 commit 028329a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/settings/DevicesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 () => {
Expand Down Expand Up @@ -110,7 +111,7 @@ const DevicesPage = () => {
<FormControlLabel
control={(
<Switch
value={showAll}
checked={showAll}
onChange={(e) => setShowAll(e.target.checked)}
size="small"
/>
Expand Down

0 comments on commit 028329a

Please sign in to comment.