diff --git a/client/src/App.tsx b/client/src/App.tsx index d69a1fb..8ed61e4 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -204,7 +204,7 @@ function App() { const doAddClickFoodChoice = async (location: LunchChoice, foodIndex?: number) => { if (document.getSelection()?.type !== 'Range') { // pouze pokud se nejedná o výběr textu - if (auth?.login) { + if (canChangeChoice && auth?.login) { await addChoice({ body: { locationKey: location, foodIndex, dayIndex } }); } } @@ -212,7 +212,7 @@ function App() { const doAddChoice = async (event: React.ChangeEvent) => { const locationKey = event.target.value as LunchChoice; - if (auth?.login) { + if (canChangeChoice && auth?.login) { await addChoice({ body: { locationKey, dayIndex } }); if (foodChoiceRef.current?.value) { foodChoiceRef.current.value = ""; @@ -348,7 +348,7 @@ function App() { } else if (menu?.food?.length && menu.food.length > 0) { const hideSoups = settings?.hideSoups; content = - + {menu.food.map((f: Food, index: number) => (!hideSoups || !f.isSoup) && doAddClickFoodChoice(location, index)}> @@ -376,7 +376,7 @@ function App() { content =

Chyba načtení dat

} return -

doAddClickFoodChoice(location)}>{getLunchChoiceName(location)}

+

doAddClickFoodChoice(location)}>{getLunchChoiceName(location)}

{menu?.lastUpdate && Poslední aktualizace: {getHumanDateTime(new Date(menu.lastUpdate))}} {content}