mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 00:45:47 +01:00
✨ Add cache and stale timers for most react query
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Autocomplete, createStyles, Flex, Tabs, TextInput } from '@mantine/core';
|
||||
import { Autocomplete, createStyles, Flex, Tabs } from '@mantine/core';
|
||||
import { UseFormReturnType } from '@mantine/form';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
@@ -16,7 +16,7 @@ export const AppPing = ({ app }: AppPingProps) => {
|
||||
(config?.settings.customization.layout.enabledPing && app.network.enabledStatusChecker) ??
|
||||
false;
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: [`ping/${app.id}`],
|
||||
queryKey: ['ping', { id: app.id, name: app.name }],
|
||||
queryFn: async () => {
|
||||
const response = await fetch(`/api/modules/ping?url=${encodeURI(app.url)}`);
|
||||
const isOk = app.network.okStatus.includes(response.status);
|
||||
|
||||
Reference in New Issue
Block a user