This commit is contained in:
parent
f4e31cea36
commit
a34614c8db
@ -192,11 +192,13 @@ function App() {
|
|||||||
}, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]);
|
}, [auth?.login, easterEgg?.duration, easterEgg?.url, eggImage]);
|
||||||
|
|
||||||
const doAddClickFoodChoice = async (location: Locations, foodIndex?: number) => {
|
const doAddClickFoodChoice = async (location: Locations, foodIndex?: number) => {
|
||||||
|
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;
|
const locationKey = Object.keys(Locations).find(key => Locations[key as keyof typeof Locations] === location) as LocationKey;
|
||||||
if (auth?.login) {
|
if (auth?.login) {
|
||||||
await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex));
|
await errorHandler(() => addChoice(locationKey, foodIndex, dayIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const doAddChoice = async (event: React.ChangeEvent<HTMLSelectElement>) => {
|
const doAddChoice = async (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||||
const locationKey = event.target.value as LocationKey;
|
const locationKey = event.target.value as LocationKey;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user