From 3beff7e9721e20a1df278fd5e2b3533ef25c295d Mon Sep 17 00:00:00 2001 From: maxime Date: Fri, 16 Feb 2024 21:43:17 +0100 Subject: [PATCH] remove debug logs and format --- Documentation/how-to-dev.md | 3 ++- src/pages/Editor.tsx | 3 +-- src/pages/LoginPage.tsx | 16 ++++++++++++++-- src/pages/template/Header.tsx | 2 -- vite.config.ts | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Documentation/how-to-dev.md b/Documentation/how-to-dev.md index 97a9fa1..0834d22 100644 --- a/Documentation/how-to-dev.md +++ b/Documentation/how-to-dev.md @@ -1,7 +1,8 @@ # THIS FILE IS DEPRECATED + See [#107](https://codefirst.iut.uca.fr/git/IQBall/Application-Web/pulls/107) for more details ------ +--- This documentation file explains how to start a development server on your machine, and how it works under the hood. diff --git a/src/pages/Editor.tsx b/src/pages/Editor.tsx index 5bd05b9..45eb129 100644 --- a/src/pages/Editor.tsx +++ b/src/pages/Editor.tsx @@ -115,7 +115,6 @@ export default function EditorPage({ guestMode }: EditorPageProps) { } async function initialize() { - console.log("initializing") const infoResponse = fetchAPIGet(`tactics/${id}`) const contentResponse = fetchAPIGet(`tactics/${id}/1`) const { name, courtType } = await (await infoResponse).json() @@ -675,7 +674,7 @@ function CourtPlayerArrowAction({ })) }} onHeadPicked={(headPos) => { - (document.activeElement as HTMLElement).blur() + ;(document.activeElement as HTMLElement).blur() setPreviewAction({ origin: playerInfo.id, diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx index d41ae87..d868ba2 100644 --- a/src/pages/LoginPage.tsx +++ b/src/pages/LoginPage.tsx @@ -17,7 +17,12 @@ export default function LoginApp() { const email = emailRef.current!.value const password = passwordRef.current!.value - const response = await fetchAPI("auth/token", { email, password }, "POST", false) + const response = await fetchAPI( + "auth/token", + { email, password }, + "POST", + false, + ) if (response.ok) { const session = getSession() @@ -29,7 +34,14 @@ export default function LoginApp() { // if unauthorized : if (response.status === 401) { - setErrors([{ type: "Non autorisé", messages: ["L'adresse email ou le mot de passe sont invalide."] }]) + setErrors([ + { + type: "Non autorisé", + messages: [ + "L'adresse email ou le mot de passe sont invalide.", + ], + }, + ]) return } diff --git a/src/pages/template/Header.tsx b/src/pages/template/Header.tsx index 4322aa9..5f93ae7 100644 --- a/src/pages/template/Header.tsx +++ b/src/pages/template/Header.tsx @@ -19,8 +19,6 @@ export function Header() { return } - console.log(session) - //TODO check if the response is ok and handle errors const { name: username } = await response.json() saveSession({ ...session, username }) diff --git a/vite.config.ts b/vite.config.ts index 93ea92c..1408a24 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,7 @@ import svgr from "vite-plugin-svgr" // https://vitejs.dev/config/ export default defineConfig({ build: { - target: 'es2023', + target: "es2023", }, plugins: [ react(),