Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Coder2195Text authored Nov 20, 2022
2 parents 440513e + 8903197 commit 95cb0fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { SessionProvider } from "next-auth/react";
import { Session } from "next-auth";
import { useEffect } from "react";


export default function App({
Component,
pageProps: { session, ...pageProps },
}: AppProps) {

useEffect(() => {
function alertError(message: string | Event) {
if (typeof window !== undefined) {
Expand All @@ -17,7 +19,6 @@ export default function App({
console.error = alertError;
window.onerror = alertError;
}, []);

session = session as Session;
return (
<SessionProvider session={session}>
Expand Down
6 changes: 6 additions & 0 deletions pages/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export default function Form() {
setErrors("Please give a match description");
return;
}
if (data?.discordTag == "undefined#undefined") {
setErrors(
"Your login might be corrupted. Log out and back in. Reason: Username was undefined#undefined"
);
return;
}
setSubmitting(true);
fetch("/api/upsert", {
method: "POST",
Expand Down

1 comment on commit 95cb0fc

@vercel
Copy link

@vercel vercel bot commented on 95cb0fc Nov 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.