Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/groups/[groupId]/expenses/expense-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@
: undefined,
],
isReimbursement: true,
splitMode: defaultSplittingOptions.splitMode,
// Mark as paid reimbursements should always be split evenly
// independent of any stored default splitting options.
splitMode: 'EVENLY',
saveDefaultSplittingOptions: false,
documents: [],
notes: '',
Expand Down Expand Up @@ -318,7 +320,7 @@

useEffect(() => {
setManuallyEditedParticipants(new Set())
}, [form.watch('splitMode'), form.watch('amount')])

Check warning on line 323 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

Check warning on line 323 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked

useEffect(() => {
const splitMode = form.getValues().splitMode
Expand Down Expand Up @@ -368,10 +370,10 @@
}
form.setValue('paidFor', newPaidFor, { shouldValidate: true })
}
}, [

Check warning on line 373 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has missing dependencies: 'form' and 'groupCurrency.decimal_digits'. Either include them or remove the dependency array
manuallyEditedParticipants,
form.watch('amount'),

Check warning on line 375 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
form.watch('splitMode'),

Check warning on line 376 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
])

const [usingCustomConversionRate, setUsingCustomConversionRate] = useState(
Expand All @@ -382,7 +384,7 @@
if (!usingCustomConversionRate && exchangeRate.data) {
form.setValue('conversionRate', exchangeRate.data)
}
}, [exchangeRate.data, usingCustomConversionRate])

Check warning on line 387 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array

useEffect(() => {
if (!form.getFieldState('originalAmount').isTouched) return
Expand All @@ -402,10 +404,10 @@
form.setValue('amount', Number(v))
}
}
}, [

Check warning on line 407 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has missing dependencies: 'form' and 'groupCurrency.decimal_digits'. Either include them or remove the dependency array
form.watch('originalAmount'),

Check warning on line 408 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
form.watch('conversionRate'),

Check warning on line 409 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
form.getFieldState('originalAmount').isTouched,

Check warning on line 410 in src/app/groups/[groupId]/expenses/expense-form.tsx

View workflow job for this annotation

GitHub Actions / checks

React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked
])

let conversionRateMessage = ''
Expand Down