fix(inbound): preserve custom share strategy on edit (#5225)

This commit is contained in:
iYuan
2026-06-13 00:38:01 +08:00
committed by GitHub
parent 6e20588236
commit 90e6217749
2 changed files with 39 additions and 1 deletions
@@ -381,7 +381,8 @@ export default function InboundFormModal({
// protocol reset drops a nodeId that no longer applies.
useEffect(() => {
if (!open) return;
if (!nodeShareOptionAvailable && shareAddrStrategy === 'node') {
const current = form.getFieldValue('shareAddrStrategy') as InboundFormValues['shareAddrStrategy'] | undefined;
if (!nodeShareOptionAvailable && (current ?? 'node') === 'node') {
form.setFieldValue('shareAddrStrategy', 'listen');
}
// eslint-disable-next-line react-hooks/exhaustive-deps