From cdbb92ca9756fbbf3fd12a9ba8e1c4165a23b5e6 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Tue, 14 Mar 2023 17:08:16 +0100 Subject: [PATCH] fix: minor modifcations --- components/admin/CandidateField.tsx | 1 + components/admin/CandidatesField.tsx | 17 ----------------- services/utils.ts | 1 - 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/components/admin/CandidateField.tsx b/components/admin/CandidateField.tsx index aef7f6d..afb009d 100644 --- a/components/admin/CandidateField.tsx +++ b/components/admin/CandidateField.tsx @@ -58,6 +58,7 @@ const CandidateField = ({ : null, transition, }; + console.log("CANDIDATE", candidate) return (
{ const disabled = candidates.filter((c) => c.name !== '').length < 2; - // At mounting, if candidates are the default ones, change them for candidate.default translation string - // TODO - useEffect(() => { - if (candidates.length == 2 && candidates.every(c => c.name == "")) { - candidates.forEach(c => { - c.name = t("admin.candidate-name-placeholder"); - c.active = true - }) - dispatch({ - type: ElectionTypes.SET, - field: "candidates", - value: [...candidates, defaultCandidate], - }) - } - }, []); - - // What to do when we change the candidates useEffect(() => { // Initialize the list with at least two candidates diff --git a/services/utils.ts b/services/utils.ts index 072ba12..ea131a1 100644 --- a/services/utils.ts +++ b/services/utils.ts @@ -6,7 +6,6 @@ import {NextRouter} from 'next/router'; import {URL_APP} from './constants'; export const getLocaleShort = (router: NextRouter): string => { - console.log("router", router) if (!router.locale) { return router.defaultLocale.substring(0, 2); }