@@ -22,6 +22,8 @@ import useDirDetection from '@/hooks/use-dir-detection'
2222import useDynamicErrorHandler from '@/hooks/use-dynamic-errors.ts'
2323import { cn } from '@/lib/utils'
2424import {
25+ getGeneralSettings ,
26+ getGetGeneralSettingsQueryKey ,
2527 getGetGroupsSimpleQueryKey ,
2628 useCreateUser ,
2729 useCreateUserFromTemplate ,
@@ -39,7 +41,7 @@ import { parseDateInput } from '@/utils/dateTimeParsing'
3941import { bytesToFormGigabytes , formatBytes , gbToBytes } from '@/utils/formatByte'
4042import { invalidateUserMetricsQueries , upsertUserInUsersCache } from '@/utils/usersCache'
4143import { generateWireGuardKeyPair , getWireGuardPublicKey } from '@/utils/wireguard'
42- import { useQueryClient } from '@tanstack/react-query'
44+ import { useQuery , useQueryClient } from '@tanstack/react-query'
4345import { CalendarClock , CalendarPlus , ChevronDown , EllipsisVertical , Info , Layers , Link2Off , ListStart , Lock , Network , PieChart , RefreshCcw , Group , Users , Pencil , UserRoundPlus } from 'lucide-react'
4446import React , { useEffect , useState } from 'react'
4547import { UseFormReturn } from 'react-hook-form'
@@ -492,6 +494,13 @@ function UserModal({ isDialogOpen, onOpenChange, form, editingUser, editingUserI
492494 } ,
493495 )
494496
497+ const { data : generalSettings } = useQuery ( {
498+ queryKey : getGetGeneralSettingsQueryKey ( ) ,
499+ queryFn : ( ) => getGeneralSettings ( ) ,
500+ enabled : isDialogOpen ,
501+ refetchOnMount : true ,
502+ } )
503+
495504 const syncUserCacheFromApiResponse = ( user : UserResponse , options ?: { allowInsert ?: boolean ; notifySuccessCallback ?: boolean } ) => {
496505 upsertUserInUsersCache ( queryClient , user , { allowInsert : options ?. allowInsert ?? false } )
497506 invalidateUserMetricsQueries ( queryClient )
@@ -2768,4 +2777,4 @@ function UserModal({ isDialogOpen, onOpenChange, form, editingUser, editingUserI
27682777 )
27692778}
27702779
2771- export default UserModal
2780+ export default UserModal
0 commit comments