Added persistent sort to more locations
All checks were successful
Deploy to production / build (push) Successful in 18s

This commit is contained in:
2026-10-20 18:58:52 -05:00
parent 2cf34f86fa
commit 2f8d3ad58e
9 changed files with 63 additions and 37 deletions

View File

@@ -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