spliit-app / spliit

Free and Open Source Alternative to Splitwise. Share expenses with your friends and family.
https://spliit.app
MIT License
1.17k stars 185 forks source link

"Mark as paid" incorrectly selects all group members as recipients #197

Open bitgroestl opened 4 months ago

bitgroestl commented 4 months ago

How to reproduce

Problem

After following the steps above, all users are selected in the "Paid for" section.

Expectation

Only one user should be selected (the one who we want to reimburse)

Possible cause

I'd guess the cause lies somewhere below here. I might be wrong though, since i don't have any TypeScript experience.

Shoggomo commented 2 months ago

It seems this useEffect fires, when the page loads. It shouldn't and I couldn't see why it did. https://github.com/spliit-app/spliit/blob/5dfe03b3f11e16e16355e65ef092da77715b4bd1/src/components/expense-form.tsx#L254C1-L261C4

MischaDy commented 2 months ago

This bug actually messed up our reimbursements! 😅 (we didn't read carefully enough.) I think a fix here would be important! Cheers :)

Shoggomo commented 1 month ago

I think this was resolved with #210