Oprava nefunkčního odebrání prvního vybraného jídla
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful

This commit is contained in:
Martin Berka 2025-03-11 20:57:37 +01:00
parent f0d56f11aa
commit f09bc44d63

View File

@ -244,7 +244,7 @@ export async function removeChoice(login: string, trusted: boolean, locationKey:
if (locationKey in data.choices) {
if (data.choices[locationKey] && login in data.choices[locationKey]) {
const index = data.choices[locationKey][login].selectedFoods?.indexOf(foodIndex);
if (index && index > -1) {
if (index != null && index > -1) {
data.choices[locationKey][login].selectedFoods?.splice(index, 1);
await storage.setData(selectedDay, data);
}