``update Remove unused import path suffix and comment out unused useRequireAuth hook``

This commit is contained in:
2025-05-16 15:55:30 +08:00
parent 34a7ff7ac9
commit c87357ff24
2 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
import { usePocketBase } from './usePocketBase.tsx'; import { usePocketBase } from './usePocketBase';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import IListeningPracticeCategory from '../interfaces/IListeningPracticeCategory.tsx'; import IListeningPracticeCategory from '../interfaces/IListeningPracticeCategory';
const useListQuizListeningPracticeContent = () => { const useListQuizListeningPracticeContent = () => {
const { user, pb } = usePocketBase(); const { user, pb } = usePocketBase();

View File

@@ -36,15 +36,15 @@ export const usePocketBase = () => {
return context; return context;
}; };
export const useRequireAuth = () => { // export const useRequireAuth = () => {
const { pb, user } = usePocketBase(); // const { pb, user } = usePocketBase();
const navigate = useNavigate(); // const navigate = useNavigate();
useEffect(() => { // useEffect(() => {
if (!pb.authStore.isValid) { // if (!pb.authStore.isValid) {
navigate(URLS.LOGIN); // navigate(URLS.LOGIN);
} // }
}, [pb.authStore.isValid, navigate]); // }, [pb.authStore.isValid, navigate]);
return user; // return user;
}; // };