fix eslint config

This commit is contained in:
Nathaniel Tampus
2023-05-12 19:23:00 +08:00
parent e990ed9f57
commit c71ee3056d
7 changed files with 17 additions and 8 deletions

View File

@@ -1,7 +1,9 @@
import "@/styles/globals.css";
import Header from "@/components/Header";
import type { ReactNode } from "react";
import Footer from "@/components/Footer";
import Header from "@/components/Header";
import AuthModal from "@/components/auth/AuthModal";
import ContextProvider from "@/context/ContextProvider";
@@ -34,7 +36,7 @@ export const metadata = {
metadataBase: new URL(process.env.VERCEL ? "https://ches.su" : "http://localhost:3000")
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" className="overflow-x-hidden">
<body className="overflow-x-hidden">

View File

@@ -1,12 +1,13 @@
"use client";
import type { User } from "@chessu/types";
import type { ReactNode } from "react";
import { useEffect, useState } from "react";
import { fetchSession } from "@/lib/auth";
import { SessionContext } from "./session";
export default function ContextProvider({ children }: { children: React.ReactNode }) {
export default function ContextProvider({ children }: { children: ReactNode }) {
const [user, setUser] = useState<User | null>({});
async function getSession() {

View File

@@ -11,7 +11,9 @@ export const fetchSession = async () => {
const user: User = await res.json();
return user;
}
} catch (err) {}
} catch (err) {
// do nothing
}
};
export const setGuestSession = async (name: string) => {