mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-26 14:26:07 +00:00
fix(clients): keep VLESS xtls-rprx-vision flow when inbound options reload (#5971)
The client form cleared the `flow` field whenever `showFlow` was false, but `showFlow` is derived from the inbound options list, which is transiently empty while the options query (re)loads (`inboundOptionsQuery.data ?? []`). During that window `showFlow` is a false negative, so the effect silently dropped a valid `xtls-rprx-vision` flow the user had picked for a Reality/TLS inbound and never restored it — the client was then saved with an empty flow and could not connect with XTLS Vision. Guard the clear so it only runs once the inbound options are actually available. Adds a regression test that reproduces the drop across an options reload. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -373,10 +373,15 @@ export default function ClientFormModal({
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!showFlow && flow) {
|
||||
// Only clear the flow once we actually have inbound options to judge
|
||||
// capability from. While the options list is momentarily empty (e.g. the
|
||||
// options query is (re)loading and `inbounds` falls back to `[]`), showFlow
|
||||
// is a false negative, so clearing here would silently drop a valid
|
||||
// xtls-rprx-vision flow the user picked for a Reality/TLS inbound.
|
||||
if (inbounds.length > 0 && !showFlow && flow) {
|
||||
methods.setValue('flow', '');
|
||||
}
|
||||
}, [showFlow, flow, methods]);
|
||||
}, [inbounds, showFlow, flow, methods]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!showReverseTag && reverseTag) {
|
||||
|
||||
Reference in New Issue
Block a user