Skip to content

Commit 4f1eff6

Browse files
authored
fix: swap EnableRecipientAddress switch fix (#6405)
1 parent 91def42 commit 4f1eff6

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/kit/src/views/Swap/pages/components/SwapHeaderRightActionContainer.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ const SwapSlippageCustomContent = ({
225225
const SwapSettingsDialogContent = () => {
226226
const intl = useIntl();
227227
const { slippageItem } = useSwapSlippagePercentageModeInfo();
228-
const [{ swapEnableRecipientAddress }, setSettings] = useSettingsAtom();
228+
const [{ swapEnableRecipientAddress }, setNoPersistSettings] =
229+
useSettingsAtom();
229230
const [{ swapBatchApproveAndSwap }, setPersistSettings] =
230231
useSettingsPersistAtom();
231-
const [, setNoPersistSettings] = useSettingsAtom();
232232
const rightTrigger = useMemo(
233233
() => (
234234
<SegmentControl
@@ -308,14 +308,16 @@ const SwapSettingsDialogContent = () => {
308308
})}
309309
value={swapEnableRecipientAddress}
310310
onChange={(v) => {
311-
setSettings((s) => ({
312-
...s,
313-
swapEnableRecipientAddress: v,
314-
}));
315-
if (!v) {
311+
if (v) {
312+
setNoPersistSettings((s) => ({
313+
...s,
314+
swapEnableRecipientAddress: v,
315+
}));
316+
} else {
316317
setNoPersistSettings((s) => ({
317318
...s,
318-
swapToAnotherAccountSwitchOn: false,
319+
swapEnableRecipientAddress: v,
320+
swapToAnotherAccountSwitchOn: v,
319321
}));
320322
}
321323
}}

0 commit comments

Comments
 (0)