- const vid = parseInt(c.vid);
- if (isNaN(vid) || vid <= 0)
- return "Please select a variant";
-
- const tcParts = c.timeControl.replace(/ /g,"").split('+');
- const mainTime = tcParts[0].match(/([0-9]+)([smhd])/);
- if (!mainTime)
- return "Wrong time control";
- const mainTimeValue = parseInt(mainTime[1]);
- const mainTimeUnit = mainTime[2];
- if (isNaN(mainTimeValue) || mainTimeValue <= 0)
- return "Main time should be strictly positive";
- c.mainTime = timeUnitToSeconds(mainTimeValue, mainTimeUnit);
+ const tcParts = timeControl.replace(/ /g,"").split('+');
+ const mainTimeArray = tcParts[0].match(/([0-9]+)([smhd])/);
+ if (!mainTimeArray)
+ return null;
+ const mainTimeValue = parseInt(mainTimeArray[1]);
+ const mainTimeUnit = mainTimeArray[2];
+ const mainTime = timeUnitToSeconds(mainTimeValue, mainTimeUnit);
+ let increment = 0;