From: Benjamin Auder Date: Thu, 20 Feb 2020 21:12:38 +0000 (+0100) Subject: Fix problem checking before sending to server X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/user/doc/html/common.css?a=commitdiff_plain;h=032312bfa24f306e84645645f76d40773149ac49;p=vchess.git Fix problem checking before sending to server --- diff --git a/client/src/data/problemCheck.js b/client/src/data/problemCheck.js index d0978cbc..b9fe04df 100644 --- a/client/src/data/problemCheck.js +++ b/client/src/data/problemCheck.js @@ -4,5 +4,9 @@ export function checkProblem(p) { if (!V.IsGoodFen(p.fen)) return "Errors in FEN"; + if (p.instruction.trim().length == 0) return "Empty instructions"; + + if (p.solution.trim().length == 0) return "Empty solution"; + return ""; } diff --git a/client/src/translations/en.js b/client/src/translations/en.js index ef9f291e..6d5d0ec2 100644 --- a/client/src/translations/en.js +++ b/client/src/translations/en.js @@ -51,7 +51,9 @@ export const translations = { Logout: "Logout", "Logout successful!": "Logout successful!", "Missing email": "Missing email", + "Missing instructions": "Missing instructions", "Missing name": "Missing name", + "Missing solution": "Missing solution", "Modifications applied!": "Modifications applied!", "Move played:": "Move played:", "Mutual agreement": "Mutual agreement", diff --git a/client/src/translations/es.js b/client/src/translations/es.js index e51720a4..192c5320 100644 --- a/client/src/translations/es.js +++ b/client/src/translations/es.js @@ -51,7 +51,9 @@ export const translations = { Logout: "Logout", "Logout successful!": "¡Desconexión exitosa!", "Missing email": "Email falta", + "Missing instructions": "Instrucciones faltan", "Missing name": "Nombre falta", + "Missing solution": "Solución falta", "Modifications applied!": "¡Modificaciones aplicadas!", "Move played:": "Movimiento jugado:", "Mutual agreement": "Acuerdo mutuo", diff --git a/client/src/translations/fr.js b/client/src/translations/fr.js index d3533fcb..e229d0a0 100644 --- a/client/src/translations/fr.js +++ b/client/src/translations/fr.js @@ -51,7 +51,9 @@ export const translations = { Logout: "Logout", "Logout successful!": "Déconnection réussie !", "Missing email": "Email manquant", + "Missing instructions": "Instructions manquantes", "Missing name": "Nom manquant", + "Missing solution": "Solution manquante", "Modifications applied!": "Modifications effectuées !", "Move played:": "Coup joué :", "Mutual agreement": "Accord mutuel",