fix: minor modifcations

pull/100/head
Pierre-Louis Guhur 1 year ago
parent eb5a1b2cc1
commit cdbb92ca97

@ -58,6 +58,7 @@ const CandidateField = ({
: null,
transition,
};
console.log("CANDIDATE", candidate)
return (
<div

@ -36,23 +36,6 @@ const CandidatesField = ({onSubmit}) => {
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

@ -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);
}

Loading…
Cancel
Save