diff --git a/client/src/App.tsx b/client/src/App.tsx index c62a387..c2f6937 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -84,7 +84,7 @@ function App() { }).catch(e => { setFailure(true); }) - }, [dayIndex]); + }, [dayIndex, auth]); // Registrace socket eventů useEffect(() => { @@ -158,9 +158,9 @@ function App() { // Navigace mezi dny pomocí klávesových šípek const handleKeyDown = useCallback((e: any) => { - if (e.keyCode == 37 && dayIndex != null && dayIndex > 0) { + if (e.keyCode === 37 && dayIndex != null && dayIndex > 0) { handleDayChange(dayIndex - 1); - } else if (e.keyCode == 39 && dayIndex != null && dayIndex < 4) { + } else if (e.keyCode === 39 && dayIndex != null && dayIndex < 4) { handleDayChange(dayIndex + 1); } }, [dayIndex]); @@ -385,7 +385,7 @@ function App() { </Row> <div className='content-wrapper'> <div className='content'> - {dayIndex == null || dayIndex >= data.todayWeekIndex && <> + {(dayIndex == null || dayIndex >= data.todayWeekIndex) && <> <p>{`Jak to ${dayIndex == null || dayIndex === data.todayWeekIndex ? 'dnes' : 'tento den'} vidíš s obědem?`}</p> <Form.Select ref={choiceRef} onChange={doAddChoice}> <option></option>