fix access settings page update
This commit is contained in:
parent
8e0fa4fd97
commit
20a5ae987d
@ -2,7 +2,7 @@ import { Flex, Group, Text } from '@mantine/core';
|
||||
import { useMediaQuery } from '@mantine/hooks';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAdminRole } from '../hooks/useAdminRole';
|
||||
import { frigateApi, frigateQueryKeys } from '../services/frigate.proxy/frigate.api';
|
||||
@ -27,7 +27,6 @@ const AccessSettings = () => {
|
||||
const isMobile = useMediaQuery(dimensions.mobileSize)
|
||||
const [roleId, setRoleId] = useState<string>()
|
||||
|
||||
|
||||
if (isPending || adminLoading) return <OverlayCogwheelLoader />
|
||||
if (isError || adminError || !data) return <RetryErrorPage onRetry={refetch} />
|
||||
if (!isAdmin) return <Forbidden />
|
||||
|
||||
@ -17,7 +17,7 @@ const CamerasTransferList = ({
|
||||
const { t } = useTranslation()
|
||||
const queryClient = useQueryClient()
|
||||
const { data: cameras, isPending, isError, refetch } = useQuery({
|
||||
queryKey: [frigateQueryKeys.getCamerasWHost],
|
||||
queryKey: [frigateQueryKeys.getCamerasWHost, roleId],
|
||||
queryFn: () => frigateApi.getCamerasWHost()
|
||||
})
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user