``update Remove unused import path suffix and comment out unused useRequireAuth hook
``
This commit is contained in:
@@ -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();
|
||||
|
@@ -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;
|
||||
// };
|
||||
|
Reference in New Issue
Block a user