mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-07 03:26:42 +08:00
Persist show all devices
This commit is contained in:
parent
62f6da1f5c
commit
028329ae74
@ -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 = () => {
|
||||
<FormControlLabel
|
||||
control={(
|
||||
<Switch
|
||||
value={showAll}
|
||||
checked={showAll}
|
||||
onChange={(e) => setShowAll(e.target.checked)}
|
||||
size="small"
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user