mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-22 06:39:08 +02:00
make management switch accessible
This commit is contained in:
@@ -39,12 +39,21 @@ export function WelcomeStepManagement({
|
||||
const trimmedUrl = url.trim();
|
||||
const syntaxValid = mode === ManagementMode.Cloud || isValidManagementUrl(trimmedUrl);
|
||||
const inputRef = useRef<HTMLInputElement | null>(null);
|
||||
const initialMountRef = useRef(true);
|
||||
const initialSelfHostedRef = useRef(!startsCloud);
|
||||
|
||||
useEffect(() => {
|
||||
setSyntaxError(null);
|
||||
setUnreachable(false);
|
||||
}, [url, mode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (initialMountRef.current && initialSelfHostedRef.current) {
|
||||
inputRef.current?.focus();
|
||||
}
|
||||
initialMountRef.current = false;
|
||||
}, []);
|
||||
|
||||
const handleContinue = useCallback(async () => {
|
||||
if (checking) return;
|
||||
if (mode === ManagementMode.SelfHosted && (!trimmedUrl || !syntaxValid)) {
|
||||
@@ -102,7 +111,6 @@ export function WelcomeStepManagement({
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
error={inputError}
|
||||
warning={inputWarning}
|
||||
autoFocus
|
||||
spellCheck={false}
|
||||
autoComplete={"off"}
|
||||
autoCorrect={"off"}
|
||||
|
||||
Reference in New Issue
Block a user