diff --git a/webui/src/pages/Settings.jsx b/webui/src/pages/Settings.jsx index 1849c91..35c01d5 100644 --- a/webui/src/pages/Settings.jsx +++ b/webui/src/pages/Settings.jsx @@ -458,7 +458,8 @@ function Settings() { useEffect(() => { if (domainMode !== 'pic_ngo') { setPicAvail(null); return; } const name = identity.cell_name; - if (!name) { setPicAvail(null); return; } + // No check needed when the name hasn't changed from what's already registered. + if (!name || name === loadedCellName) { setPicAvail(null); return; } clearTimeout(picAvailTimerRef.current); setPicAvail(null); picAvailTimerRef.current = setTimeout(async () => { @@ -471,7 +472,7 @@ function Settings() { } }, 900); return () => clearTimeout(picAvailTimerRef.current); - }, [identity.cell_name, domainMode]); // eslint-disable-line react-hooks/exhaustive-deps + }, [identity.cell_name, domainMode, loadedCellName]); // eslint-disable-line react-hooks/exhaustive-deps const saveIdentity = useCallback(async () => { if (ipRangeError || cellNameError || domainError) return; @@ -649,15 +650,12 @@ function Settings() { useEffect(() => { if (!identityDirty) return; if (ipRangeError || cellNameError || domainError) return; - // In pic_ngo mode, if the cell name differs from what was last saved/loaded, - // only auto-save once the check confirms the name is available. - // All other states (null, 'checking', 'taken', 'unreachable') block auto-save. - if (domainMode === 'pic_ngo' && identity.cell_name !== loadedCellName) { - if (picAvail !== 'available') return; - } + // pic_ngo cell name changes require DDNS re-registration (irreversible: releases the + // old subdomain). Never auto-save these — the user must explicitly press Accept. + if (domainMode === 'pic_ngo' && identity.cell_name !== loadedCellName) return; const timer = setTimeout(() => saveIdentityRef.current(), 800); return () => clearTimeout(timer); - }, [identity, identityDirty, ipRangeError, cellNameError, domainError, domainMode, picAvail, loadedCellName]); // eslint-disable-line react-hooks/exhaustive-deps + }, [identity, identityDirty, ipRangeError, cellNameError, domainError, domainMode, loadedCellName]); // eslint-disable-line react-hooks/exhaustive-deps useEffect(() => { const timers = SERVICE_DEFS