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) {
try {
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) {
await setNodeStatus(state.server, state.token);
await setNodeStatus(node, token);
}
const config = await getNodeConfig(state.server, state.token);
const { server, token } = state;
updateState({ busy: false });
navigate('/dashboard', { state: { config, server, token }});
const config = await getNodeConfig(node, token);
updateState({ server: node, busy: false });
navigate('/dashboard', { state: { config, server: node, token }});
}
catch (err) {
console.log(err);

View File

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