summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-04-26 14:26:46 -0700
committerMichael Hunteman <michael@huntm.net>2024-04-26 14:26:46 -0700
commit60a6a39e5da9841db4a892d1e3a0b00356f08009 (patch)
tree455fa898e6a16890b8d49e12e43b0c2ef8f69657
parentc67f9987cad34ec1a0a03e72326173d23e3f4360 (diff)
Show one less than party size
-rw-r--r--src/components/RsvpForm.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/RsvpForm.tsx b/src/components/RsvpForm.tsx
index b9dd991..9e957f8 100644
--- a/src/components/RsvpForm.tsx
+++ b/src/components/RsvpForm.tsx
@@ -63,10 +63,10 @@ function RsvpForm() {
});
const handleParty = () => {
- const partySize = Number(watch('partySize'));
+ const partySize = Number(watch('partySize')) - 1;
if (
partySize > previousPartySize.current &&
- partySize > 1 &&
+ partySize > 0 &&
partySize < 10
) {
append(
@@ -76,7 +76,7 @@ function RsvpForm() {
})
);
previousPartySize.current = partySize;
- } else if (partySize < previousPartySize.current && partySize > 0) {
+ } else if (partySize < previousPartySize.current && partySize >= 0) {
remove(
[...Array(previousPartySize.current - partySize).keys()].map(
(_, i) => partySize - 1 + i