Skip to content

Commit b04dd36

Browse files
Fix equal split with one participant resetting on edit (#168)
1 parent 71c561a commit b04dd36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store/addStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export function calculateSplitShareBasedOnAmount(
270270
// For equal split, split share should be amount/participants or 0 if amount is 0
271271
updatedParticipants = participants.map((p) => ({
272272
...p,
273-
splitShare: p.amount === 0 ? 0 : 1,
273+
splitShare: (paidBy?.id === p.id ? (p.amount ?? 0) - amount : p.amount) === 0 ? 0 : 1,
274274
}));
275275
break;
276276

0 commit comments

Comments
 (0)