trimming whitespace on admin server name

This commit is contained in:
balzack 2022-12-28 15:52:39 -08:00
parent 67f905ddd4
commit acc846c88f
2 changed files with 8 additions and 7 deletions

View File

@ -66,14 +66,15 @@ export function useAdmin() {
if (!state.busy) { if (!state.busy) {
try { try {
updateState({ busy: true }); updateState({ busy: true });
const unclaimed = await getNodeStatus(state.server); const node = state.server.trim();
const token = state.token;
const unclaimed = await getNodeStatus(node);
if (unclaimed) { if (unclaimed) {
await setNodeStatus(state.server, state.token); await setNodeStatus(node, token);
} }
const config = await getNodeConfig(state.server, state.token); const config = await getNodeConfig(node, token);
const { server, token } = state; updateState({ server: node, busy: false });
updateState({ busy: false }); navigate('/dashboard', { state: { config, server: node, token }});
navigate('/dashboard', { state: { config, server, token }});
} }
catch (err) { catch (err) {
console.log(err); console.log(err);

View File

@ -51,7 +51,7 @@ export function useReset() {
if (!state.busy) { if (!state.busy) {
try { try {
updateState({ busy: true }); updateState({ busy: true });
await app.actions.access(state.server, state.token); await app.actions.access(state.server.trim(), state.token);
updateState({ busy: false }); updateState({ busy: false });
} }
catch (err) { catch (err) {