Added persistent sort to more locations
All checks were successful
Deploy to production / build (push) Successful in 18s
All checks were successful
Deploy to production / build (push) Successful in 18s
This commit is contained in:
@@ -19,6 +19,7 @@ import DebouncedWolClient from './DebouncedWolClient';
|
||||
import WolClientSettingsItem from './WolClientSettingsItem';
|
||||
|
||||
export function WolClients() {
|
||||
const { isMobile, theme, settings, updateSetting } = useCommonHooks();
|
||||
const defaultWolClient: WolClient = {
|
||||
id: undefined,
|
||||
hostname: '',
|
||||
@@ -38,7 +39,6 @@ export function WolClients() {
|
||||
const { data: wolClientsData, isFetching: wolClientsIsFetching } = useQueryAPI({
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const [sortBy, setSortBy] = useState('Oldest');
|
||||
const [searchValue, setSearchValue] = useState<string | number>('');
|
||||
const [debouncedSearch] = useDebouncedValue(searchValue, 500);
|
||||
const wolClients: WolClient[] =
|
||||
@@ -49,7 +49,7 @@ export function WolClients() {
|
||||
a.macAddress.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
|
||||
)
|
||||
.sort((a: WolClient, b: WolClient) => {
|
||||
switch (sortBy) {
|
||||
switch (settings.wolClientsSettingsSort) {
|
||||
case 'A>Z':
|
||||
return a.hostname.toLocaleLowerCase() > b.hostname.toLocaleLowerCase()
|
||||
? 1
|
||||
@@ -73,7 +73,6 @@ export function WolClients() {
|
||||
}
|
||||
}) || [];
|
||||
const { mutateAsync } = useMutationAPI();
|
||||
const { isMobile, theme } = useCommonHooks();
|
||||
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@@ -179,8 +178,10 @@ export function WolClients() {
|
||||
searchPlaceholder={'Search Clients...'}
|
||||
isLoading={isLoading}
|
||||
setIsLoading={setIsLoading}
|
||||
sortBy={sortBy}
|
||||
setSortBy={setSortBy}
|
||||
sortBy={settings.wolClientsSettingsSort}
|
||||
setSortBy={(value) => {
|
||||
updateSetting('wolClientsSettingsSort', value);
|
||||
}}
|
||||
customSearchEnabled={false}
|
||||
/>
|
||||
<Stack
|
||||
|
||||
Reference in New Issue
Block a user