This commit is contained in:
@@ -18,8 +18,6 @@ import Loader from './components/Loader';
|
||||
import { getHumanDateTime, isInTheFuture } from './Utils';
|
||||
import NoteModal from './components/modals/NoteModal';
|
||||
import { useEasterEgg } from './context/eggs';
|
||||
import { Link } from 'react-router';
|
||||
import { STATS_URL } from './AppRoutes';
|
||||
import { ClientData, Food, PizzaOrder, DepartureTime, PizzaDayState, Restaurant, RestaurantDayMenu, RestaurantDayMenuMap, LunchChoice, UserLunchChoice, PizzaVariant, getData, getEasterEggImage, addPizza, removePizza, updatePizzaDayNote, createPizzaDay, deletePizzaDay, lockPizzaDay, unlockPizzaDay, finishOrder, finishDelivery, addChoice, jdemeObed, removeChoices, removeChoice, updateNote, changeDepartureTime } from '../../types';
|
||||
import { getLunchChoiceName } from './enums';
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ export default function PizzaCalculatorModal({ isOpen, onClose }: Readonly<Props
|
||||
// 1. pizza
|
||||
if (diameter1Ref.current?.value) {
|
||||
const diameter1 = parseInt(diameter1Ref.current?.value);
|
||||
if (!r.pizza1) {
|
||||
r.pizza1 = {};
|
||||
}
|
||||
r.pizza1 ??= {};
|
||||
if (diameter1 && diameter1 > 0) {
|
||||
r.pizza1.diameter = diameter1;
|
||||
r.pizza1.area = Math.PI * Math.pow(diameter1 / 2, 2);
|
||||
@@ -59,9 +57,7 @@ export default function PizzaCalculatorModal({ isOpen, onClose }: Readonly<Props
|
||||
// 2. pizza
|
||||
if (diameter2Ref.current?.value) {
|
||||
const diameter2 = parseInt(diameter2Ref.current?.value);
|
||||
if (!r.pizza2) {
|
||||
r.pizza2 = {};
|
||||
}
|
||||
r.pizza2 ??= {};
|
||||
if (diameter2 && diameter2 > 0) {
|
||||
r.pizza2.diameter = diameter2;
|
||||
r.pizza2.area = Math.PI * Math.pow(diameter2 / 2, 2);
|
||||
|
||||
Reference in New Issue
Block a user