Add eslint rule and fix as many issues as possible

This commit is contained in:
Khoa Le
2023-06-19 23:42:04 -04:00
parent e9eacc445d
commit 9d33e4756b
689 changed files with 9446 additions and 21821 deletions
@@ -1,10 +1,10 @@
import { ReactNode, useEffect } from 'react';
import { useRouter } from 'next/router';
import { ReactNode, useEffect } from "react";
import { useRouter } from "next/router";
import { publicPaths } from '@app/const';
import { useToggle } from '@app/hooks';
import { useGetAuthToken } from '@app/hooks/api';
import { isLoggedIn } from '@app/reactQuery';
import { publicPaths } from "@app/const";
import { useToggle } from "@app/hooks";
import { useGetAuthToken } from "@app/hooks/api";
import { isLoggedIn } from "@app/reactQuery";
type Props = {
children: ReactNode;
@@ -26,7 +26,7 @@ export const AuthProvider = ({ children }: Props): JSX.Element => {
if (!isLoading) {
// not a public path and not authenticated kick to login page
if (!publicPaths.includes(pathname) && !isLoggedIn()) {
push('/login').then(() => {
push("/login").then(() => {
setIsReady.on();
});
} else {
+1 -1
View File
@@ -1 +1 @@
export { AuthProvider } from './AuthContext';
export { AuthProvider } from "./AuthContext";