mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 07:25:48 +01:00
🐛 Fix failing query when not authorized
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
IconWorld,
|
||||
TablerIconsProps,
|
||||
} from '@tabler/icons-react';
|
||||
import { useSession } from 'next-auth/react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { ReactNode, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useConfigContext } from '~/config/provider';
|
||||
@@ -23,7 +24,10 @@ export const Search = ({ isMobile }: SearchProps) => {
|
||||
const [search, setSearch] = useState('');
|
||||
const ref = useRef<HTMLInputElement>(null);
|
||||
useHotkeys([['mod+K', () => ref.current?.focus()]]);
|
||||
const { data: userWithSettings } = api.user.withSettings.useQuery();
|
||||
const { data: sessionData } = useSession();
|
||||
const { data: userWithSettings } = api.user.withSettings.useQuery(undefined, {
|
||||
enabled: !!sessionData?.user,
|
||||
});
|
||||
const { config } = useConfigContext();
|
||||
const { colors } = useMantineTheme();
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user