Skip to content

Commit dc21c89

Browse files
fix(OUT-3609): prevent settings save when bank deposit enabled without bank account
Block the Confirm/Update button when bankDepositFeeFlag is on but no bank account is selected. Without a bank account, the webhook deposit flow throws on every payment.succeeded event. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f6e3eba commit dc21c89

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/hook/useSettings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,11 @@ export const useInvoiceDetailSettings = () => {
561561

562562
useEffect(() => {
563563
if (!settingState || !intialSettingState) return
564-
setShowButton(!equal(intialSettingState, settingState))
564+
const hasChanges = !equal(intialSettingState, settingState)
565+
// Block submit if bank deposit is on but no bank account selected
566+
const missingBankAccount =
567+
settingState.bankDepositFeeFlag && !settingState.bankAccountRef
568+
setShowButton(hasChanges && !missingBankAccount)
565569
}, [settingState, intialSettingState])
566570

567571
useEffect(() => {

0 commit comments

Comments
 (0)