mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-23 03:27:43 +09:00
Keep a server name typed during the pair lookup
The lookup's answer checked the name as it was when the code was typed, so a name entered while it was in flight was overwritten with the agent's hostname.
This commit is contained in:
1 parent
ada4d49ea4
commit
89eb7fb2e3
1 file changed
+1
-2
@@ -588,7 +588,7 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
|
||||
// the agent didn't supply one.
|
||||
const suggestedName = res.system_info?.display_name
|
||||
|| res.system_info?.hostname;
|
||||
if (!name && suggestedName) setName(suggestedName);
|
||||
if (suggestedName) setName((prev) => prev || suggestedName);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (cancelled) return;
|
||||
@@ -598,7 +598,6 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
|
||||
if (!cancelled) setLoading(false);
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [formattedCode]);
|
||||
|
||||
async function handleClaim(e) {
|
||||
|
||||
Reference in new issue
Block a user