From 7cf9179a8711b60fb69603a65585bb5ea91c0713 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Tue, 13 Jan 2026 16:03:31 +0100 Subject: [PATCH] =?UTF-8?q?Neumo=C5=BEn=C4=9Bn=C3=AD=20v=C3=BDb=C4=9Bru=20?= =?UTF-8?q?j=C3=ADdla=20kliknut=C3=ADm=20do=20minulosti?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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}