``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 { 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();
|
||||||
|
@@ -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;
|
||||||
};
|
// };
|
||||||
|
Reference in New Issue
Block a user