Skip to content

Commit

Permalink
fix: swap EnableRecipientAddress switch fix (#6405)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezailWang authored Dec 24, 2024
1 parent 91def42 commit 4f1eff6
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ const SwapSlippageCustomContent = ({
const SwapSettingsDialogContent = () => {
const intl = useIntl();
const { slippageItem } = useSwapSlippagePercentageModeInfo();
const [{ swapEnableRecipientAddress }, setSettings] = useSettingsAtom();
const [{ swapEnableRecipientAddress }, setNoPersistSettings] =
useSettingsAtom();
const [{ swapBatchApproveAndSwap }, setPersistSettings] =
useSettingsPersistAtom();
const [, setNoPersistSettings] = useSettingsAtom();
const rightTrigger = useMemo(
() => (
<SegmentControl
Expand Down Expand Up @@ -308,14 +308,16 @@ const SwapSettingsDialogContent = () => {
})}
value={swapEnableRecipientAddress}
onChange={(v) => {
setSettings((s) => ({
...s,
swapEnableRecipientAddress: v,
}));
if (!v) {
if (v) {
setNoPersistSettings((s) => ({
...s,
swapEnableRecipientAddress: v,
}));
} else {
setNoPersistSettings((s) => ({
...s,
swapToAnotherAccountSwitchOn: false,
swapEnableRecipientAddress: v,
swapToAnotherAccountSwitchOn: v,
}));
}
}}
Expand Down

0 comments on commit 4f1eff6

Please sign in to comment.