From a34614c8db2dd50d474589e4aaa60786ffd87db0 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Thu, 27 Feb 2025 21:36:21 +0100 Subject: [PATCH] Oprava #6 --- client/src/App.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 2b3933a..e1c2ef2 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -192,9 +192,11 @@ function App() { }, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]); const doAddClickFoodChoice = async (location: Locations, foodIndex?: number) => { - const locationKey = Object.keys(Locations).find(key => Locations[key as keyof typeof Locations] === location) as LocationKey; - if (auth?.login) { - await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex)); + if (document.getSelection()?.type !== 'Range') { // pouze pokud se nejedná o výběr textu + const locationKey = Object.keys(Locations).find(key => Locations[key as keyof typeof Locations] === location) as LocationKey; + if (auth?.login) { + await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex)); + } } }