mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5225] [MERGED] fix(inbound): preserve custom share strategy on edit #5823
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5823
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5225
Author: @yuanzhidao
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/12/2026
Merged by: @MHSanaei
Base:
main← Head:fix/inbound-share-strategy-form-state📝 Commits (1)
4addc8ffix(inbound): preserve custom share strategy on edit📊 Changes
2 files changed (+39 additions, -1 deletions)
View changed files
📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+2 -1)📝
frontend/src/test/inbound-form-modal.test.tsx(+37 -0)📄 Description
Summary
Preserve an inbound's saved custom share address strategy when reopening the edit form for a local inbound where the node share option is unavailable.
Why
Fixes #5224.
The edit modal initialized the saved inbound values, but a later effect used a stale watched
shareAddrStrategyvalue from the previous render. For local inbounds without an available node share option, that stale default could overwrite a savedcustomstrategy withlisten, so saving the form would lose the custom share address selection.Type of change
Areas affected
How was this tested?
Added a regression test for editing a local inbound with
shareAddrStrategy: "custom"andshareAddr: "edge.example.test"; before the form-state fix, the custom share address field was not rendered because the strategy was overwritten tolisten.Validated locally with:
cd frontend && npm run test -- src/test/inbound-form-modal.test.tsx src/test/inbound-link.test.ts src/test/inbound-form-adapter.test.tscd frontend && npm run testcd frontend && npm run typecheckcd frontend && npm run lintcd frontend && npm run buildgo build ./...go test ./...git diff --check origin/main...HEADA real multi-node panel deployment was not run; this change is covered by a focused form-state regression test plus the existing link/form adapter suites.
Screenshots / recordings
N/A. This fixes form state preservation without changing the visual layout.
Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.