Problem
`addWithdrawalHistory` (`hooks/use-auto-withdraw.ts`, lines 79-92) updates React state via a functional updater, but calls `saveSettings(stream.id, {...settings, ...})` using the stale closed-over `settings` (lines 86-89) instead of the updated value.
Location
`hooks/use-auto-withdraw.ts:79-92`
Impact
A settings change made between renders can be silently reverted in localStorage when a withdrawal history entry is added shortly after, with no indication anything went wrong.
Suggested fix
Persist settings via the latest value (e.g. a ref updated alongside state, or restructure so save always reads current state) rather than a stale closure.
Problem
`addWithdrawalHistory` (`hooks/use-auto-withdraw.ts`, lines 79-92) updates React state via a functional updater, but calls `saveSettings(stream.id, {...settings, ...})` using the stale closed-over `settings` (lines 86-89) instead of the updated value.
Location
`hooks/use-auto-withdraw.ts:79-92`
Impact
A settings change made between renders can be silently reverted in localStorage when a withdrawal history entry is added shortly after, with no indication anything went wrong.
Suggested fix
Persist settings via the latest value (e.g. a ref updated alongside state, or restructure so save always reads current state) rather than a stale closure.