* chore: upgrade minor versions
* chore: upgrade cypress
* chore: upgrade fe dependencies
* update readme
* update osx images
* update readme
* upgrade dependencies
* upgrade test dependency
* feat: add option to input autofill
* feat: autofill to the left
* chore: update docs
* chore: cleanup ci
* version bump
* style: prevent zero height bar
* fix: prevent loosing menu
* ux: improve input, no spellcheck or autocomplete
* small ux improvements in cuesheets
* feat 111/increase maximum number of events
* fix: optimistic delete issue with filter
* refact: pincode workflow
* chore: add versioning to packages
This commit is contained in:
Carlos Valente
2022-05-19 10:48:56 +02:00
committed by GitHub
parent 45ac44b2e8
commit 6ac963684d
155 changed files with 3481 additions and 3465 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { Editable, EditableInput, EditablePreview } from '@chakra-ui/editable';
import { forgivingStringToMillis } from '../utils/dateConfig';
import { LoggingContext } from '../../app/context/LoggingContext';
@@ -7,12 +7,12 @@ import { stringFromMillis } from '../utils/time';
import style from './EditableTimer.module.scss';
export default function EditableTimer(props) {
const { name, actionHandler, time, delay, validate, previousEnd } = props;
const { name, actionHandler, time = 0, delay, validate, previousEnd } = props;
const { emitError } = useContext(LoggingContext);
const [value, setValue] = useState('');
const handleSubmit = (value) => {
const handleSubmit = useCallback((value) => {
// Check if there is anything there
if (value === '') return false;
@@ -46,10 +46,10 @@ export default function EditableTimer(props) {
actionHandler('update', { field: name, value: newValMillis });
return true;
};
},[actionHandler, delay, name, previousEnd, time, validate]);
// prepare time fields
const validateValue = (value) => {
const validateValue = useCallback((value) => {
const success = handleSubmit(value);
if (success) {
const ms = forgivingStringToMillis(value);
@@ -57,7 +57,7 @@ export default function EditableTimer(props) {
} else {
setValue(stringFromMillis(time + delay));
}
};
},[delay, handleSubmit, time]);
useEffect(() => {
if (time == null) return;