``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 IListeningPracticeCategory from '../interfaces/IListeningPracticeCategory.tsx';
import IListeningPracticeCategory from '../interfaces/IListeningPracticeCategory';
const useListQuizListeningPracticeContent = () => {
const { user, pb } = usePocketBase();

View File

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