Skip to content

Commit 4f3b0be

Browse files
committed
fix: disable refetch on window focus
1 parent 86b8ee9 commit 4f3b0be

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/shared/api/query-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { sToMs } from '../utils/time-utils'
55
export const queryClient = new QueryClient({
66
defaultOptions: {
77
queries: {
8-
refetchOnWindowFocus: true,
8+
refetchOnWindowFocus: false,
99
refetchIntervalInBackground: false,
1010
retry: false,
1111
gcTime: sToMs(120),

src/widgets/dashboard/hosts/edit-host-modal/edit-host-modal.widget.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { UpdateHostCommand } from '@remnawave/backend-contract'
22
import { zodResolver } from 'mantine-form-zod-resolver'
33
import { notifications } from '@mantine/notifications'
4+
import { memo, useEffect, useState } from 'react'
45
import { useTranslation } from 'react-i18next'
5-
import { Drawer, Text } from '@mantine/core'
6-
import { useEffect, useState } from 'react'
76
import { modals } from '@mantine/modals'
87
import { useForm } from '@mantine/form'
8+
import { Drawer } from '@mantine/core'
99
import consola from 'consola/browser'
1010

1111
import {
@@ -20,7 +20,7 @@ import { BaseHostForm } from '@shared/ui/forms/hosts/base-host-form'
2020
import { queryClient } from '@shared/api'
2121
import {} from '@entities/dashboard'
2222

23-
export const EditHostModalWidget = () => {
23+
export const EditHostModalWidget = memo(() => {
2424
const { t } = useTranslation()
2525

2626
const { isOpen, internalState: host } = useModalState(MODALS.EDIT_HOST_MODAL)
@@ -286,7 +286,7 @@ export const EditHostModalWidget = () => {
286286
padding="lg"
287287
position="right"
288288
size="lg"
289-
title={<Text fw={500}>{t('edit-host-modal.widget.edit-host')}</Text>}
289+
title={t('edit-host-modal.widget.edit-host')}
290290
>
291291
{host && (
292292
<BaseHostForm
@@ -302,4 +302,4 @@ export const EditHostModalWidget = () => {
302302
)}
303303
</Drawer>
304304
)
305-
}
305+
})

0 commit comments

Comments
 (0)