Skip to content

Commit

Permalink
Merge pull request #22 from FalkorDB/warning
Browse files Browse the repository at this point in the history
Fix #21 Clean load time warnings
  • Loading branch information
gkorland authored Jan 21, 2024
2 parents 5f713e7 + 1d42822 commit f458e4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import Navbar from '@/components/custom/navbar'
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable'
import NextAuth from 'next-auth'
import { NextAuthProvider } from './providers'
import { Toaster } from '@/components/ui/toaster'

Expand All @@ -19,8 +16,10 @@ export default function RootLayout({
}: {
children: React.ReactNode
}) {
// Setting suppressHydrationWarning on html tag to prevent warning
// caused by mismatched client/server content caused by next-themes
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<NextAuthProvider>{children}</NextAuthProvider>
<Toaster />
Expand Down
12 changes: 6 additions & 6 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

import { Button } from "@/components/ui/button";
import { signIn, useSession } from "next-auth/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";

import { useEffect } from "react";

export default function Home() {
const { data: session, status } = useSession()
const router = useRouter()

// Check session if already signed in redirect to graph page
if (status === "authenticated") {
router.push("/graph")
}
useEffect(() => {
if (status === "authenticated") {
router.push("/graph")
}
}, [router, session, status]);

return (
<div className="flex flex-col items-center justify-center min-h-screen py-2">
Expand Down

0 comments on commit f458e4b

Please sign in to comment.